Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 33 additions & 8 deletions building/macos/build.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,44 @@
set -euo pipefail

# Build FGCS for macOS (arm64 by default). Run from any directory.
# Usage: ./build.sh <version>
# Usage: ./build.sh [version]
# If no version is provided, the script will show current version and prompt for new one

if [[ ${1:-} == "" ]]; then
echo "Usage: $0 <version>"
echo "Example: $0 0.2.0-alpha"
exit 1
fi

VERSION="$1"
VERSION="${1:-}"

echo "Assuming location is FGCS/building/macos"
cd ../../

# Read and display current version from package.json
echo "Reading current version from package.json..."
PACKAGE_JSON_PATH="./gcs/package.json"
if [[ -f "$PACKAGE_JSON_PATH" ]]; then
CURRENT_VERSION=$(grep '"version"' "$PACKAGE_JSON_PATH" | sed 's/.*"version": *"\([^"]*\)".*/\1/')
echo "Current version: $CURRENT_VERSION"

# Prompt for version if not provided
if [[ -z "$VERSION" ]]; then
read -p "Enter new version number: " VERSION
if [[ -z "$VERSION" ]]; then
echo "Error: Version is required to continue"
exit 1
fi
fi

echo "New version will be: $VERSION"
else
echo "Warning: Could not find package.json at $PACKAGE_JSON_PATH"

# Still prompt for version if package.json not found
if [[ -z "$VERSION" ]]; then
read -p "Enter version number: " VERSION
if [[ -z "$VERSION" ]]; then
echo "Error: Version is required to continue"
exit 1
fi
fi
fi

echo "Building backend"
cd radio
source ./venv/bin/activate
Expand Down
35 changes: 33 additions & 2 deletions building/windows/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,48 @@

.EXAMPLE
.\build.ps1 -Version "0.1.8-alpha"
.\build.ps1
#>

Param (
[Parameter(Mandatory = $true)]
[Parameter(Mandatory = $false)]
[string]$Version
)

Write-Output "Building backend"
Write-Output "Assuming location is FGCS\building\windows"
Set-Location ../../

# Read and display current version from package.json
Write-Output "Reading current version from package.json..."
$packageJsonPath = ".\gcs\package.json"
if (Test-Path $packageJsonPath) {
$packageJson = Get-Content $packageJsonPath | ConvertFrom-Json
$currentVersion = $packageJson.version
Write-Output "Current version: $currentVersion"

# Prompt for version if not provided
if (-not $Version) {
$Version = Read-Host "Enter new version number"
if (-not $Version) {
Write-Error "Version is required to continue"
exit 1
}
}

Write-Output "New version will be: $Version"
} else {
Write-Warning "Could not find package.json at $packageJsonPath"

# Still prompt for version if package.json not found
if (-not $Version) {
$Version = Read-Host "Enter version number"
if (-not $Version) {
Write-Error "Version is required to continue"
exit 1
}
}
}

Write-Output "Building backend"
Comment thread
1Blademaster marked this conversation as resolved.
Set-Location radio
pip install pyinstaller
Expand Down