-
Notifications
You must be signed in to change notification settings - Fork 11
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
20d8a9f
commit f80a9e1
Showing
2 changed files
with
28 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,26 @@ | ||
#!/usr/bin/env bash | ||
# shellcheck disable=SC2015 | ||
|
||
# | ||
# Update: 2024-02-29 | ||
# | ||
|
||
throw() { echo -e "fatal: $1" >&2; exit 1; } | ||
execute() { echo "$ $*"; "$@" || throw "Failed to execute '$1'"; } | ||
command -v jq >/dev/null || throw "jq is not installed! (https://jqlang.github.io/jq/)"; | ||
|
||
# change the current directory to the project directory | ||
pushd "$( dirname -- "${BASH_SOURCE[0]}" )/.." >/dev/null || exit 1; | ||
|
||
execute mkdir -p "./artifacts/npm"; | ||
|
||
PKG_NAME="$(awk '/"name"/{ print substr($2,2, length($2)-3); }' ./package.json)" | ||
PKG_VERSION="$(awk '/"version"/{ print substr($2,2, length($2)-3); }' ./package.json)" | ||
PKG="${PKG_NAME}-${PKG_VERSION}"; | ||
PKG="$(jq -r '.name+"-"+.version' ./package.json)"; | ||
TARGET_DIR="./artifacts/npm"; | ||
LIST_FILE="./artifacts/npm/${PKG}.list"; | ||
echo "PKG=${PKG}"; | ||
|
||
npm pack --dryrun 2>&1 | | ||
sed 's/npm notice//' | | ||
tee "./artifacts/npm/${PKG}.list"; | ||
execute mkdir -p "$TARGET_DIR"; | ||
|
||
echo "created './artifacts/vscode/${PKG}.list'"; | ||
echo "$ npm pack --dryrun | tee $LIST_FILE"; | ||
npm pack --dryrun 2>&1 | sed 's/npm notice//' | tee "$LIST_FILE"; | ||
|
||
execute npm pack; | ||
execute mv -f "${PKG}.tgz" "./artifacts/npm"; | ||
execute mv -f "${PKG}.tgz" "$TARGET_DIR"; |
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 |
---|---|---|
@@ -1,18 +1,25 @@ | ||
#!/usr/bin/env bash | ||
|
||
# | ||
# Update: 2024-02-29 | ||
# | ||
throw() { echo -e "fatal: $1" >&2; exit 1; } | ||
execute() { echo "$ $*"; "$@" || throw "Failed to execute '$1'"; } | ||
command -v jq >/dev/null || throw "jq is not installed! (https://jqlang.github.io/jq/)"; | ||
|
||
# change the current directory to the project directory | ||
pushd "$( dirname -- "${BASH_SOURCE[0]}" )/.." >/dev/null || exit 1; | ||
|
||
mkdir -p "./artifacts/vscode"; | ||
PKG="$(jq -r '.name+"-"+.version' ./package.json)"; | ||
TARGET_DIR="./artifacts/vscode"; | ||
LIST_FILE="./artifacts/vscode/${PKG}.list"; | ||
echo "PKG=${PKG}"; | ||
|
||
PKG_NAME="$(awk '/"name"/{ print substr($2,2, length($2)-3); }' ./package.json)" | ||
PKG_VERSION="$(awk '/"version"/{ print substr($2,2, length($2)-3); }' ./package.json)" | ||
PKG="${PKG_NAME}-${PKG_VERSION}"; | ||
execute mkdir -p "$TARGET_DIR"; | ||
|
||
echo "$ ./scripts/vsce.sh ls | tee $LIST_FILE"; | ||
bash ./scripts/vsce.sh ls | | ||
awk '!/Detected presence of yarn.lock/' | | ||
tee "./artifacts/vscode/${PKG}.list"; | ||
|
||
echo "created './artifacts/vscode/${PKG}.list'"; | ||
tee "$LIST_FILE"; | ||
|
||
bash ./scripts/vsce.sh package --out "./artifacts/vscode/${PKG}.vsix" | ||
execute bash ./scripts/vsce.sh package --out "${TARGET_DIR}/${PKG}.vsix"; |