File tree Expand file tree Collapse file tree 3 files changed +21
-14
lines changed Expand file tree Collapse file tree 3 files changed +21
-14
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ function docker-build() {
26
26
27
27
function docker-exec() {
28
28
local command=" ${1} " ; shift
29
- local args=" '${vscodeVersion} ' '${codeServerVersion} ' ' ${target} ' "
29
+ local args=" '${vscodeVersion} ' '${codeServerVersion} '"
30
30
docker exec " ${containerId} " \
31
31
bash -c " cd /src && CI=true GITHUB_TOKEN=${token} MINIFY=${minify} yarn ${command} ${args} "
32
32
}
Original file line number Diff line number Diff line change @@ -212,7 +212,7 @@ function in-vscode () {
212
212
if [[ ! -f " ${maybeVsCode} /package.json" ]] ; then
213
213
return 1
214
214
fi
215
- if ! grep ' "name": "code-oss-dev"' " ${maybeVsCode} /package.json" --quiet ; then
215
+ if ! grep ' "name": "code-oss-dev"' " ${maybeVsCode} /package.json" -q ; then
216
216
return 1
217
217
fi
218
218
return 0
@@ -264,17 +264,24 @@ function main() {
264
264
local codeServerVersion=" ${1} " ; shift
265
265
local ci=" ${CI:- } "
266
266
local minify=" ${MINIFY:- } "
267
+
267
268
local arch
268
269
arch=$( uname -m)
269
- local target=" ${1:- } "
270
- if [[ -z " ${target} " ]] ; then
271
- local ostype=" ${OSTYPE:- } "
272
- if [[ " ${ostype} " == " darwin" * ]] ; then
273
- target=" darwin"
274
- else
275
- target=" linux"
270
+
271
+ local target=" linux"
272
+ local ostype=" ${OSTYPE:- } "
273
+ if [[ " ${ostype} " == " darwin" * ]] ; then
274
+ target=" darwin"
275
+ else
276
+ # On Alpine there seems no way to get the version except to use an invalid
277
+ # command which will output the version to stderr and exit with 1.
278
+ local output
279
+ output=$( ldd --version 2>&1 || :)
280
+ if [[ " ${output} " == " musl" * ]] ; then
281
+ target=" alpine"
276
282
fi
277
283
fi
284
+
278
285
local binaryName=" code-server${codeServerVersion} -vsc${vscodeVersion} -${target} -${arch} "
279
286
local buildPath=" ${stagingPath} /${binaryName} -built"
280
287
Original file line number Diff line number Diff line change @@ -124,11 +124,11 @@ export class UpdateService extends AbstractUpdateService {
124
124
private async buildReleaseName ( release : string ) : Promise < string > {
125
125
let target : string = os . platform ( ) ;
126
126
if ( target === "linux" ) {
127
- const result = await util . promisify ( cp . exec ) ( "ldd --version" ) ;
128
- if ( result . stderr ) {
129
- throw new Error ( result . stderr ) ;
130
- }
131
- if ( result . stdout . indexOf ( "musl" ) !== - 1 ) {
127
+ const result = await util . promisify ( cp . exec ) ( "ldd --version" ) . catch ( ( error ) => ( {
128
+ stderr : error . message ,
129
+ stdout : "" ,
130
+ } ) ) ;
131
+ if ( result . stderr . indexOf ( "musl" ) !== - 1 || result . stdout . indexOf ( "musl" ) !== - 1 ) {
132
132
target = "alpine" ;
133
133
}
134
134
}
You can’t perform that action at this time.
0 commit comments