Use reallink for all server cli scripts

This commit is contained in:
Martin Aeschlimann 2022-03-24 15:56:16 +01:00
parent ee0c8c4f01
commit 465cac2c42
No known key found for this signature in database
GPG key ID: 4B615CF8ED6ADC96
5 changed files with 48 additions and 4 deletions

View file

@ -311,13 +311,13 @@ function packageTask(type, platform, arch, sourceFolderName, destinationFolderNa
);
} else if (platform === 'linux' || platform === 'alpine' || platform === 'darwin') {
result = es.merge(result,
gulp.src('resources/server/bin/remote-cli/code.sh', { base: '.' })
gulp.src(`resources/server/bin/remote-cli/${platform === 'darwin' ? 'code-darwin.sh' : 'code-linux.sh'}`, { base: '.' })
.pipe(replace('@@VERSION@@', version))
.pipe(replace('@@COMMIT@@', commit))
.pipe(replace('@@APPNAME@@', product.applicationName))
.pipe(rename(`bin/remote-cli/${product.applicationName}`))
.pipe(util.setExecutableBit()),
gulp.src('resources/server/bin/helpers/browser.sh', { base: '.' })
gulp.src(`resources/server/bin/helpers/${platform === 'darwin' ? 'browser-darwin.sh' : 'browser-linux.sh'}`, { base: '.' })
.pipe(replace('@@VERSION@@', version))
.pipe(replace('@@COMMIT@@', commit))
.pipe(replace('@@APPNAME@@', product.applicationName))

View file

@ -0,0 +1,22 @@
#!/usr/bin/env sh
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
realdir() {
SOURCE=$1
while [ -h "$SOURCE" ]; do
DIR=$(dirname "$SOURCE")
SOURCE=$(readlink "$SOURCE")
[[ $SOURCE != /* ]] && SOURCE=$DIR/$SOURCE
done
echo "$( cd -P "$(dirname "$SOURCE")" >/dev/null 2>&1 && pwd )"
}
ROOT=$(dirname "$(realdir "$0")")
APP_NAME="@@APPNAME@@"
VERSION="@@VERSION@@"
COMMIT="@@COMMIT@@"
EXEC_NAME="@@APPNAME@@"
CLI_SCRIPT="$ROOT/out/server-cli.js"
"$ROOT/node" "$CLI_SCRIPT" "$APP_NAME" "$VERSION" "$COMMIT" "$EXEC_NAME" "--openExternal" "$@"

View file

@ -2,7 +2,7 @@
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
ROOT=$(dirname "$(dirname "$(dirname "$0")")")
ROOT="$(dirname "$(dirname "$(readlink -f "$0")")")"
APP_NAME="@@APPNAME@@"
VERSION="@@VERSION@@"

View file

@ -0,0 +1,22 @@
#!/usr/bin/env sh
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
realdir() {
SOURCE=$1
while [ -h "$SOURCE" ]; do
DIR=$(dirname "$SOURCE")
SOURCE=$(readlink "$SOURCE")
[[ $SOURCE != /* ]] && SOURCE=$DIR/$SOURCE
done
echo "$( cd -P "$(dirname "$SOURCE")" >/dev/null 2>&1 && pwd )"
}
ROOT=$(dirname "$(realdir "$0")")
APP_NAME="@@APPNAME@@"
VERSION="@@VERSION@@"
COMMIT="@@COMMIT@@"
EXEC_NAME="@@APPNAME@@"
CLI_SCRIPT="$ROOT/out/server-cli.js"
"$ROOT/node" "$CLI_SCRIPT" "$APP_NAME" "$VERSION" "$COMMIT" "$EXEC_NAME" "$@"

View file

@ -2,7 +2,7 @@
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
ROOT=$(dirname "$(dirname "$(dirname "$0")")")
ROOT="$(dirname "$(dirname "$(readlink -f "$0")")")"
APP_NAME="@@APPNAME@@"
VERSION="@@VERSION@@"