Skip to content

Commit

Permalink
t
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakski committed Jan 10, 2024
1 parent 5d0d297 commit f6d31f8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
10 changes: 3 additions & 7 deletions bin/download
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,9 @@ set -euo pipefail
declare \
janet_repo="https://github.com/janet-lang/janet" \
janet_version=$ASDF_INSTALL_VERSION \
jpm_repo="https://github.com/janet-lang/jpm" \
jpm_ref="master"
jpm_repo="https://github.com/janet-lang/jpm"
declare -a curl_opts=(-fsSL)

if [ -v JPM_REF ] && [ -n "$JPM_REF" ]; then
jpm_ref=""
fi
if [ -n "${GITHUB_API_TOKEN:-}" ]; then
curl_opts=("${curl_opts[@]}" -H "Authorization: token $GITHUB_API_TOKEN")
fi
Expand All @@ -23,8 +19,8 @@ if [ ! -d "${ASDF_DOWNLOAD_PATH}/janet" ]; then
curl "${curl_opts[@]}" "${janet_repo}/archive/${janet_version}.tar.gz" |
tar -C "${ASDF_DOWNLOAD_PATH}/janet" --strip-components=1 -xzf -
fi
if [ -n "$jpm_ref" ] && [ ! -d "${ASDF_DOWNLOAD_PATH}/jpm" ]; then
if [ "${JPM_REF:-" "}" != " " ] && [ ! -d "${ASDF_DOWNLOAD_PATH}/jpm" ]; then
mkdir -p "${ASDF_DOWNLOAD_PATH}/jpm"
curl "${curl_opts[@]}" "${jpm_repo}/archive/${jpm_ref}.tar.gz" |
curl "${curl_opts[@]}" "${jpm_repo}/archive/${JPM_REF:-"master"}.tar.gz" |
tar -C "${ASDF_DOWNLOAD_PATH}/jpm" --strip-components=1 -xzf -
fi
2 changes: 1 addition & 1 deletion bin/install
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ ninja -C build -j "${ASDF_CONCURRENCY:-1}"
ninja -C build install -j "${ASDF_CONCURRENCY:-1}"
popd >/dev/null
[ -x "${ASDF_INSTALL_PATH}/bin/janet" ]
if [ ! -v JPM_REF ] || [ -n "$JPM_REF" ]; then
if [ "${JPM_REF:-"master"}" != " " ]; then
pushd "${ASDF_DOWNLOAD_PATH}/jpm" >/dev/null
PREFIX="$ASDF_INSTALL_PATH" "${ASDF_INSTALL_PATH}/bin/janet" bootstrap.janet
popd >/dev/null
Expand Down

0 comments on commit f6d31f8

Please sign in to comment.