Skip to content

Commit 362f9ec

Browse files
authored
fetch-canonical_data_syncer: Download v0.17.0, not latest (#2277)
This commit alters the `fetch-canonical_data_syncer` script so that it will stay working after we make changes to the `canonical-data-syncer` repo. The plan for those changes is: 1. Rename the existing `canonical-data-syncer` repo to `configlet-v3`. 2. Use that repo to develop `configlet` for Exercism v3. The existing functionality will be adapted into a `configlet`-style CLI with a `sync` subcommand. 3. When Exercism v3 is launched, rename the existing `configlet` repo to `configlet-v2`, and the `configlet-v3` repo to `configlet`. After step 1, GitHub will redirect `canonical-data-syncer` traffic to the renamed repo. However, the fetch script was implemented to download the latest release, and in future the latest release will not be backwards-compatible with `canonical-data-syncer`: it will instead have a `configlet`-style CLI with a `sync` subcommand. Therefore, this commit alters the fetch script so that it downloads the final release of `canonical-data-syncer`. We hard-code the download by `id`, rather than by tag, giving us the option to start the `configlet_v3` versioning at `v0.1.0`. We must also add the `--location` flag to the first `curl` command so that it follows redirects. In the future, track repos can remove the `fetch-canonical_data_syncer` script by either: - adding the upcoming `fetch-configlet_v3` script - or simply waiting until the `sync` functionality is available in the repo located at `exercism/configlet`.
1 parent 8972982 commit 362f9ec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bin/fetch-canonical_data_syncer

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
set -eo pipefail
44

5-
readonly LATEST='https://api.github.com/repos/exercism/canonical-data-syncer/releases/latest'
5+
readonly FINAL_RELEASE='https://api.github.com/repos/exercism/canonical-data-syncer/releases/33439231' # v0.17.0
66

77
case "$(uname)" in
88
(Darwin*) OS='mac' ;;
@@ -35,7 +35,7 @@ fi
3535
FILENAME="canonical_data_syncer-${OS}-${ARCH}.${EXT}"
3636

3737
get_url () {
38-
curl --header "$HEADER" -s "$LATEST" |
38+
curl --header "$HEADER" -s --location "${FINAL_RELEASE}" |
3939
awk -v filename=$FILENAME '$1 ~ /browser_download_url/ && $2 ~ filename { print $2 }' |
4040
tr -d '"'
4141
}

0 commit comments

Comments
 (0)