#!/bin/sh # NOTE: This script assumes that the url is a .tar.gz file. if [ "$#" -lt 1 ]; then printf '%s\n' "usage: $0 EXTRACT_DIR" >&2 printf '%s\n' "EXTRACT_DIR is the directory to enter after extracting the archive." >&2 exit 2 fi set -ex # print all that we're doing (no need for echo's) env tmpdir=$(mktemp -d) wget "$SCI_PIPELINE_URL" -P "$tmpdir" cd "$tmpdir" tar xf *.tar.gz cd "$1" sh .sci.sh cd - rm -rf "$tmpdir"