-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
65bcf27
commit ce99a25
Showing
11 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
# can't symlink to ../nanoseconds or else YP_DIR detection in ../nanoseconds fails | ||
|
||
YP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." >/dev/null && pwd)" | ||
${YP_DIR}/bin/nanoseconds "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
# NOTE since this folder is meant to be appended to $PATH as | ||
# PATH=${PATH}:path/to/yplatform/bin/.nanoseconds | ||
# calling 'nanoseconds' might call the system executable 'nanoseconds'. | ||
# This scripts assumes that there's no system executable 'yp-nanoseconds', | ||
# so it will always call our 'bin/nanoseconds' script. | ||
|
||
# can't symlink to ../nanoseconds or else YP_DIR detection in ../nanoseconds fails | ||
|
||
YP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." >/dev/null && pwd)" | ||
${YP_DIR}/bin/nanoseconds "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
YP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." >/dev/null && pwd)" | ||
source ${YP_DIR}/sh/common.inc.sh | ||
|
||
# shellcheck disable=SC1091 | ||
VSN=$(source ${YP_DIR}/CONST.inc && echo "${YP_NANOSECONDS_VSN}") | ||
NANOSECONDS_URL=https://github.com/ysoftwareab/nanoseconds/releases/download | ||
|
||
case ${OS_SHORT}-${ARCH} in | ||
darwin-amd64|darwin-arm64) | ||
BINARY=nanoseconds_${VSN}_${OS_SHORT}_${ARCH} | ||
;; | ||
linux-amd64|linux-arm64) | ||
BINARY=nanoseconds_${VSN}_${OS_SHORT}_${ARCH} | ||
;; | ||
*) | ||
echo_err "nanoseconds: ${OS_SHORT}-${ARCH} is an unsupported OS-ARCH." | ||
exit 1 | ||
;; | ||
esac | ||
ASSET_LOCAL=${YP_DIR}/bin/nanoseconds-${VSN}/${BINARY} | ||
ASSET_REMOTE=${NANOSECONDS_URL}/v${VSN}/${BINARY} | ||
BINARY_LOCAL=${ASSET_LOCAL} | ||
|
||
[[ -f ${BINARY_LOCAL} ]] || { | ||
ASSET_LOCAL=${HOME}/.cache/yplatform/nanoseconds-${VSN}/${BINARY} | ||
BINARY_LOCAL=${ASSET_LOCAL} | ||
} | ||
|
||
[[ -f ${BINARY_LOCAL} ]] || { | ||
echo_info "Fetching ${ASSET_REMOTE}..." | ||
mkdir -p $(dirname ${ASSET_LOCAL}) | ||
curl -qfsSL \ | ||
-o ${ASSET_LOCAL} \ | ||
${ASSET_REMOTE} | ||
chmod +x ${BINARY_LOCAL} | ||
} | ||
|
||
echo_info "Proxying to 'nanoseconds' as ${BINARY_LOCAL}." | ||
${BINARY_LOCAL} "$@" |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters