@@ -52,11 +52,9 @@ main() {
52
52
fi
53
53
54
54
# Check that we're using at least v7 of npm CLI
55
- if ! command -v npm & > /dev/null; then
56
- echo " Couldn't find the npm CLI"
57
- echo " Are you sure you have it installed?"
58
- echo " Please check again with: npm -v"
59
- echo " And re-run the script."
55
+ if ! command -v jq & > /dev/null; then
56
+ echo " Couldn't find jq"
57
+ echo " We need this in order to modify the package.json for dev builds."
60
58
exit 1
61
59
fi
62
60
@@ -95,18 +93,6 @@ main() {
95
93
# See: https://github.com/coder/code-server/pull/3935
96
94
echo " node_modules.asar" > release/.npmignore
97
95
98
- # NOTE@jsjoeio - this needs to run inside the release dir
99
- # where the package.json for code-server is.
100
- pushd release
101
- if npm pkg get name && [ $? -eq 1 ]; then
102
- echo " Couldn't get package.json name with 'npm pkg get name'"
103
- echo " This usually means npm v7 or higher could not be found."
104
- echo " We use this to modify the package.json name for dev builds."
105
- echo " Please upgrade to npm v7 or higher and re-run the script."
106
- exit 1
107
- fi
108
- popd
109
-
110
96
# We use this to set the name of the package in the
111
97
# package.json
112
98
PACKAGE_NAME=" code-server"
@@ -159,8 +145,8 @@ main() {
159
145
# Use the development package name
160
146
# This is so we don't clutter the code-server versions on npm
161
147
# with development versions.
162
- # Requires npm Version 7.x or higher
163
- npm pkg set name= " $PACKAGE_NAME "
148
+ updated_package_json= " $( jq ' .name = "$PACKAGE_NAME" ' package.json ) "
149
+ echo -E " ${updated_package_json} " > package.json
164
150
popd
165
151
fi
166
152
0 commit comments