'init'
This commit is contained in:
29
build-packs.sh
Normal file
29
build-packs.sh
Normal file
@@ -0,0 +1,29 @@
|
||||
#/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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user