30 lines
1.1 KiB
Bash
30 lines
1.1 KiB
Bash
#/bin/bash
|
|
echo "Using directory: $(pwd)"
|
|
current_dir=$(pwd)
|
|
# Run npm with a timeout using perl (cross-platform alternative to 'timeout')
|
|
perl -e 'alarm shift; $SIG{ALRM}=sub{kill INT => -$$}; exec @ARGV' 10 npm run start
|
|
echo "Build complete. Packing service packs..."
|
|
|
|
APP_VERSION=$(grep -o 'APP_VERSION *= *"[^"]*' "$current_dir/app/version.ts" | sed 's/APP_VERSION *= *"//')
|
|
CORE_MIN_REQUIRED_VERSION=$(grep -o 'CORE_MIN_REQUIRED_VERSION *= *"[^"]*' "$current_dir/app/version.ts" | sed 's/CORE_MIN_REQUIRED_VERSION *= *"//')
|
|
|
|
echo "App version: $APP_VERSION"
|
|
echo "Kernel target version: $CORE_MIN_REQUIRED_VERSION"
|
|
|
|
mkdir -p "${current_dir}/packs"
|
|
rm -rf "${current_dir}/packs"/*
|
|
for PLATFORM in darwin linux win32; do
|
|
for ARCH in arm64 x64; do
|
|
ZIP_NAME="sp-${PLATFORM}-${ARCH}-${APP_VERSION}-${CORE_MIN_REQUIRED_VERSION}.zip"
|
|
SRC_DIR="${current_dir}/out/renderer/assets"
|
|
if [ -d "$SRC_DIR" ]; then
|
|
(cd "$SRC_DIR" && zip -j "${current_dir}/packs/${ZIP_NAME}" *)
|
|
echo "Packed $SRC_DIR to /packs/${ZIP_NAME}"
|
|
else
|
|
echo "Warning: $SRC_DIR does not exist, skipping."
|
|
fi
|
|
done
|
|
done
|
|
|
|
|