File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ function docker-build() {
2626
2727 function docker-exec() {
2828 local command=" ${1} " ; shift
29- local args=" '${vscodeVersion} ' '${codeServerVersion} ' ' ${target} ' "
29+ local args=" '${vscodeVersion} ' '${codeServerVersion} '"
3030 docker exec " ${containerId} " \
3131 bash -c " cd /src && CI=true GITHUB_TOKEN=${token} MINIFY=${minify} yarn ${command} ${args} "
3232 }
Original file line number Diff line number Diff line change @@ -212,7 +212,7 @@ function in-vscode () {
212212 if [[ ! -f " ${maybeVsCode} /package.json" ]] ; then
213213 return 1
214214 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
216216 return 1
217217 fi
218218 return 0
@@ -264,17 +264,24 @@ function main() {
264264 local codeServerVersion=" ${1} " ; shift
265265 local ci=" ${CI:- } "
266266 local minify=" ${MINIFY:- } "
267+
267268 local arch
268269 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"
276282 fi
277283 fi
284+
278285 local binaryName=" code-server${codeServerVersion} -vsc${vscodeVersion} -${target} -${arch} "
279286 local buildPath=" ${stagingPath} /${binaryName} -built"
280287
Original file line number Diff line number Diff line change @@ -124,11 +124,11 @@ export class UpdateService extends AbstractUpdateService {
124124 private async buildReleaseName ( release : string ) : Promise < string > {
125125 let target : string = os . platform ( ) ;
126126 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 ) {
132132 target = "alpine" ;
133133 }
134134 }
You can’t perform that action at this time.
0 commit comments