Skip to content

Commit 0b399ff

Browse files
committed
Fix sync-version script and update build scripts to use consistent bash execution.
1 parent f80cc12 commit 0b399ff

5 files changed

Lines changed: 32 additions & 23 deletions

File tree

.github/workflows/build-test.yaml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,7 @@ jobs:
8989
run: ./scripts/download-ffmpeg.sh darwin
9090

9191
- name: Sync version
92-
run: |
93-
chmod +x scripts/sync-version.sh
94-
./scripts/sync-version.sh
92+
run: bash scripts/sync-version.sh
9593

9694
- name: Prepare build directory
9795
run: |
@@ -146,9 +144,7 @@ jobs:
146144
shell: bash
147145

148146
- name: Sync version
149-
run: |
150-
chmod +x scripts/sync-version.sh
151-
./scripts/sync-version.sh
147+
run: bash scripts/sync-version.sh
152148
shell: bash
153149

154150
- name: Prepare build directory

.github/workflows/release.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,7 @@ jobs:
9898
run: ./scripts/download-ffmpeg.sh darwin
9999

100100
- name: Sync version
101-
run: |
102-
chmod +x scripts/sync-version.sh
103-
./scripts/sync-version.sh
101+
run: bash scripts/sync-version.sh
104102

105103
- name: Prepare build directory
106104
run: |
@@ -154,9 +152,7 @@ jobs:
154152
shell: bash
155153

156154
- name: Sync version
157-
run: |
158-
chmod +x scripts/sync-version.sh
159-
./scripts/sync-version.sh
155+
run: bash scripts/sync-version.sh
160156
shell: bash
161157

162158
- name: Prepare build directory

scripts/build-desktop-all.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,23 @@ set -euo pipefail
44
# Build Desktop Application for All Platforms
55
# Usage: ./scripts/build-desktop-all.sh
66

7+
# Get script directory and project root
8+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
9+
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
10+
11+
# Change to project root
12+
cd "$PROJECT_ROOT"
13+
714
echo "📦 Syncing version from package.json..."
8-
./scripts/sync-version.sh
15+
bash scripts/sync-version.sh
916

1017
echo "📋 Preparing build directory..."
1118
mkdir -p build
1219
cp images/icon.png build/appicon.png
1320

1421
echo "📦 Downloading FFmpeg for all platforms..."
15-
./scripts/download-ffmpeg.sh darwin
16-
./scripts/download-ffmpeg.sh windows
22+
bash scripts/download-ffmpeg.sh darwin
23+
bash scripts/download-ffmpeg.sh windows
1724

1825
echo "🎨 Building frontend..."
1926
cd frontend && VITE_APP_VERSION=$(node -p "require('./package.json').version") npm run build && cd ..

scripts/build-desktop.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,18 @@ set -euo pipefail
44
# Build Desktop Application
55
# Usage: ./scripts/build-desktop.sh [debug|release] [platform]
66

7+
# Get script directory and project root
8+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
9+
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
10+
711
BUILD_MODE="${1:-release}"
812
PLATFORM="${2:-}"
913

14+
# Change to project root
15+
cd "$PROJECT_ROOT"
16+
1017
echo "📦 Syncing version from package.json..."
11-
./scripts/sync-version.sh
18+
bash scripts/sync-version.sh
1219

1320
echo "📋 Preparing build directory..."
1421
mkdir -p build

scripts/sync-version.sh

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,24 @@ set -e
55
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
66
PROJECT_ROOT="$SCRIPT_DIR/.."
77

8-
# Read version from package.json
9-
VERSION=$(node -p "require('$PROJECT_ROOT/frontend/package.json').version")
8+
# Change to project root to ensure relative paths work
9+
cd "$PROJECT_ROOT"
10+
11+
# Read version from package.json (using relative path from project root)
12+
VERSION=$(node -p "require('./frontend/package.json').version")
1013

1114
echo "📦 Syncing version: $VERSION"
1215

13-
# Update wails.json
16+
# Update wails.json (now using relative path from project root)
1417
if command -v jq &> /dev/null; then
1518
# Use jq if available
16-
jq --arg version "$VERSION" '.info.productVersion = $version' "$PROJECT_ROOT/wails.json" > "$PROJECT_ROOT/wails.json.tmp"
17-
mv "$PROJECT_ROOT/wails.json.tmp" "$PROJECT_ROOT/wails.json"
19+
jq --arg version "$VERSION" '.info.productVersion = $version' wails.json > wails.json.tmp
20+
mv wails.json.tmp wails.json
1821
echo "✓ Updated wails.json to version $VERSION"
1922
else
2023
# Fallback to sed
21-
sed -i.bak "s/\"productVersion\": \".*\"/\"productVersion\": \"$VERSION\"/" "$PROJECT_ROOT/wails.json"
22-
rm -f "$PROJECT_ROOT/wails.json.bak"
24+
sed -i.bak "s/\"productVersion\": \".*\"/\"productVersion\": \"$VERSION\"/" wails.json
25+
rm -f wails.json.bak
2326
echo "✓ Updated wails.json to version $VERSION (using sed)"
2427
fi
2528

0 commit comments

Comments
 (0)