From 98c6d9ddcdfa05a3198f7d884b11e265c68315f1 Mon Sep 17 00:00:00 2001 From: Matt Parker Date: Wed, 1 Dec 2021 14:25:55 +0000 Subject: [PATCH] adding check for internet connectivity --- CHANGELOG.md | 4 ++++ main.nf | 11 ++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 22d6bb4..c3b3101 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [unreleased] +### Fixed +- Pangolin update step now checks for internet connection + ## [v0.3.6] ### Changes - Pangolin updated to 3.1.16 (Will now call B.1.1.529 successfully) diff --git a/main.nf b/main.nf index 32ac9d5..5618f5c 100644 --- a/main.nf +++ b/main.nf @@ -334,7 +334,16 @@ process pangolin { path "lineage_report.csv", emit: report path "pangolin.version", emit: version """ - pangolin --update + # Check to see if the box running the workflow has internet connectivity + EXIT_CODE=0 + wget -q --spider --timeout 10 http://nanoporetech.com || EXIT_CODE=\$? + + if [ \${EXIT_CODE} -eq 0 ]; then + pangolin --update + else + echo "Offline" + fi + pangolin --all-versions 2>&1 | sed 's/: /,/' > pangolin.version pangolin consensus.fasta """