File tree 2 files changed +28
-18
lines changed
2 files changed +28
-18
lines changed Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
# shellcheck disable=SC2015
3
3
4
+ #
5
+ # Update: 2024-02-29
6
+ #
7
+
4
8
throw () { echo -e " fatal: $1 " >&2 ; exit 1; }
5
9
execute () { echo " $ $* " ; " $@ " || throw " Failed to execute '$1 '" ; }
10
+ command -v jq > /dev/null || throw " jq is not installed! (https://jqlang.github.io/jq/)" ;
6
11
7
12
# change the current directory to the project directory
8
13
pushd " $( dirname -- " ${BASH_SOURCE[0]} " ) /.." > /dev/null || exit 1;
9
14
10
- execute mkdir -p " ./artifacts/npm" ;
11
-
12
- PKG_NAME=" $( awk ' /"name"/{ print substr($2,2, length($2)-3); }' ./package.json) "
13
- PKG_VERSION=" $( awk ' /"version"/{ print substr($2,2, length($2)-3); }' ./package.json) "
14
- PKG=" ${PKG_NAME} -${PKG_VERSION} " ;
15
+ PKG=" $( jq -r ' .name+"-"+.version' ./package.json) " ;
16
+ TARGET_DIR=" ./artifacts/npm" ;
17
+ LIST_FILE=" ./artifacts/npm/${PKG} .list" ;
18
+ echo " PKG=${PKG} " ;
15
19
16
- npm pack --dryrun 2>&1 |
17
- sed ' s/npm notice//' |
18
- tee " ./artifacts/npm/${PKG} .list" ;
20
+ execute mkdir -p " $TARGET_DIR " ;
19
21
20
- echo " created './artifacts/vscode/${PKG} .list'" ;
22
+ echo " $ npm pack --dryrun | tee $LIST_FILE " ;
23
+ npm pack --dryrun 2>&1 | sed ' s/npm notice//' | tee " $LIST_FILE " ;
21
24
22
25
execute npm pack;
23
- execute mv -f " ${PKG} .tgz" " ./artifacts/npm " ;
26
+ execute mv -f " ${PKG} .tgz" " $TARGET_DIR " ;
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
+ #
4
+ # Update: 2024-02-29
5
+ #
6
+ throw () { echo -e " fatal: $1 " >&2 ; exit 1; }
7
+ execute () { echo " $ $* " ; " $@ " || throw " Failed to execute '$1 '" ; }
8
+ command -v jq > /dev/null || throw " jq is not installed! (https://jqlang.github.io/jq/)" ;
9
+
3
10
# change the current directory to the project directory
4
11
pushd " $( dirname -- " ${BASH_SOURCE[0]} " ) /.." > /dev/null || exit 1;
5
12
6
- mkdir -p " ./artifacts/vscode" ;
13
+ PKG=" $( jq -r ' .name+"-"+.version' ./package.json) " ;
14
+ TARGET_DIR=" ./artifacts/vscode" ;
15
+ LIST_FILE=" ./artifacts/vscode/${PKG} .list" ;
16
+ echo " PKG=${PKG} " ;
7
17
8
- PKG_NAME=" $( awk ' /"name"/{ print substr($2,2, length($2)-3); }' ./package.json) "
9
- PKG_VERSION=" $( awk ' /"version"/{ print substr($2,2, length($2)-3); }' ./package.json) "
10
- PKG=" ${PKG_NAME} -${PKG_VERSION} " ;
18
+ execute mkdir -p " $TARGET_DIR " ;
11
19
20
+ echo " $ ./scripts/vsce.sh ls | tee $LIST_FILE " ;
12
21
bash ./scripts/vsce.sh ls |
13
22
awk ' !/Detected presence of yarn.lock/' |
14
- tee " ./artifacts/vscode/${PKG} .list" ;
15
-
16
- echo " created './artifacts/vscode/${PKG} .list'" ;
23
+ tee " $LIST_FILE " ;
17
24
18
- bash ./scripts/vsce.sh package --out " ./artifacts/vscode/ ${PKG} .vsix"
25
+ execute bash ./scripts/vsce.sh package --out " ${TARGET_DIR} / ${PKG} .vsix" ;
You can’t perform that action at this time.
0 commit comments