Skip to content

Commit 2aebb0f

Browse files
committed
woo
1 parent a56052d commit 2aebb0f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

ci/steps/publish-npm.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,15 @@ main() {
6565
# "production" - this means we tag with `latest` (default), allowing
6666
# a developer to install this version with `yarn add code-server@latest`
6767
if ! is_env_var_set "NPM_ENVIRONMENT"; then
68-
echo "NPM_ENVIRONMENT is not set. Determining in script based on GITHUB environment variables."
68+
echo "NPM_ENVIRONMENT is not set."
69+
echo "Determining in script based on GITHUB environment variables."
6970

7071
if [[ "$GITHUB_EVENT_NAME" == 'push' && "$GITHUB_REF" == 'refs/heads/main' ]]; then
7172
NPM_ENVIRONMENT="staging"
7273
else
7374
NPM_ENVIRONMENT="development"
7475
fi
7576

76-
echo "- npm environment: $NPM_ENVIRONMENT"
7777
fi
7878

7979
# NOTE@jsjoeio - this script assumes we have the artifact downloaded on disk
@@ -96,8 +96,6 @@ main() {
9696
NPM_TAG="latest"
9797
else
9898
COMMIT_SHA="$GITHUB_SHA"
99-
echo "Not a production environment"
100-
echo "Manually bumping npm version..."
10199

102100
if [[ "$NPM_ENVIRONMENT" == "staging" ]]; then
103101
NPM_VERSION="$VERSION-beta-$COMMIT_SHA"
@@ -117,7 +115,9 @@ main() {
117115
fi
118116

119117
echo "- tag: $NPM_TAG"
118+
echo "- version: $NPM_VERSION"
120119
echo "- package name: $PACKAGE_NAME"
120+
echo "- npm environment: $NPM_ENVIRONMENT"
121121

122122
# We modify the version in the package.json
123123
# to be the current version + the PR number + commit SHA
@@ -135,7 +135,7 @@ main() {
135135
# jq can't edit in place so we must store in memory and echo
136136
local contents
137137
contents="$(jq ".name |= \"$PACKAGE_NAME\"" package.json)"
138-
echo "${contents}" > package.json
138+
echo "${contents}" > package.json > /dev/null 2>&1
139139
popd
140140
fi
141141

@@ -145,7 +145,7 @@ main() {
145145
# if version is valid, we check if we're publishing the same one
146146

147147
local hasVersion
148-
if hasVersion=$(npm view "$PACKAGE_NAME@$NPM_VERSION" version) && [[ $hasVersion == "$NPM_VERSION" ]]; then
148+
if hasVersion=$(npm view "$PACKAGE_NAME@$NPM_VERSION" version 2> /dev/null) && [[ $hasVersion == "$NPM_VERSION" ]]; then
149149
echo "$NPM_VERSION is already published under $PACKAGE_NAME"
150150
return
151151
fi

0 commit comments

Comments
 (0)