From 3d8bbcf283dd6f0ad42e14d00cba8785daad031e Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Tue, 4 May 2021 15:27:25 +0200 Subject: [PATCH] Remove fetch-canonical-data-syncer scripts (#181) * Remove fetch-canonical-data-syncer scripts * Allow script to use cmdline options for `configlet sync` Co-authored-by: ee7 <45465154+ee7@users.noreply.github.com> Co-authored-by: Glenn Jackman Co-authored-by: ee7 <45465154+ee7@users.noreply.github.com> --- .gitignore | 1 - bin/check_test_cases | 6 ++-- bin/fetch-canonical_data_syncer | 52 --------------------------------- 3 files changed, 2 insertions(+), 57 deletions(-) delete mode 100755 bin/fetch-canonical_data_syncer diff --git a/.gitignore b/.gitignore index ffe8ec97..6a513a06 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,3 @@ .DS_Store bin/configlet bin/configlet.exe -bin/canonical_data_syncer diff --git a/bin/check_test_cases b/bin/check_test_cases index 0a74c8b7..36595467 100755 --- a/bin/check_test_cases +++ b/bin/check_test_cases @@ -4,7 +4,5 @@ die() { echo "$*" >&2; exit 1; } cd "$(dirname "$0")"/.. || die "cannot cd" bin/fetch-configlet || die "cannot fetch configlet" -bin/configlet lint . || die "resolve config.json problems first" - -bin/fetch-canonical_data_syncer || die "cannot fetch canonical_data_syncer" -bin/canonical_data_syncer --check "$@" +bin/configlet lint || die "resolve config.json problems first" +bin/configlet sync --check "$@" diff --git a/bin/fetch-canonical_data_syncer b/bin/fetch-canonical_data_syncer deleted file mode 100755 index b4cb2517..00000000 --- a/bin/fetch-canonical_data_syncer +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/bash - -set -eo pipefail - -readonly FINAL_RELEASE='https://api.github.com/repos/exercism/canonical-data-syncer/releases/33439231' # v0.17.0 - -case "$(uname)" in - (Darwin*) OS='mac' ;; - (Linux*) OS='linux' ;; - (Windows*) OS='windows' ;; - (MINGW*) OS='windows' ;; - (MSYS_NT-*) OS='windows' ;; - (*) OS='linux' ;; -esac - -case "$OS" in - (windows*) EXT='zip' ;; - (*) EXT='tgz' ;; -esac - -case "$(uname -m)" in - (*64*) ARCH='64bit' ;; - (*686*) ARCH='32bit' ;; - (*386*) ARCH='32bit' ;; - (*) ARCH='64bit' ;; -esac - -if [ -z "${GITHUB_TOKEN}" ] -then - HEADER='' -else - HEADER="authorization: Bearer ${GITHUB_TOKEN}" -fi - -FILENAME="canonical_data_syncer-${OS}-${ARCH}.${EXT}" - -get_url () { - curl --header "$HEADER" -s --location "${FINAL_RELEASE}" | - awk -v filename=$FILENAME '$1 ~ /browser_download_url/ && $2 ~ filename { print $2 }' | - tr -d '"' -} - -URL=$(get_url) - -case "$EXT" in - (*zip) - curl --header "$HEADER" -s --location "$URL" -o bin/latest-canonical_data_syncer.zip - unzip bin/latest-canonical_data_syncer.zip -d bin/ - rm bin/latest-canonical_data_syncer.zip - ;; - (*) curl --header "$HEADER" -s --location "$URL" | tar xz -C bin/ ;; -esac