mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-01-30 06:12:03 +00:00
- Added a new script (dev.mjs) to start the application in development mode with hot reloading using Vite. - The script includes functionality for installing Playwright browsers, resolving port configurations, and launching either a web or desktop application. - Removed the old init.mjs script, which was previously responsible for launching the application. - Updated package.json to reference the new dev.mjs script for the development command. - Introduced a shared utilities module (launcher-utils.mjs) for common functionalities used in both development and production scripts.
35 lines
1.3 KiB
Bash
Executable File
35 lines
1.3 KiB
Bash
Executable File
#!/usr/bin/env sh
|
|
|
|
# Try to load nvm if available (optional - works without it too)
|
|
if [ -z "$NVM_DIR" ]; then
|
|
# Check for Herd's nvm first (macOS with Herd)
|
|
if [ -s "$HOME/Library/Application Support/Herd/config/nvm/nvm.sh" ]; then
|
|
export NVM_DIR="$HOME/Library/Application Support/Herd/config/nvm"
|
|
# Then check standard nvm location
|
|
elif [ -s "$HOME/.nvm/nvm.sh" ]; then
|
|
export NVM_DIR="$HOME/.nvm"
|
|
fi
|
|
fi
|
|
|
|
# Source nvm if found (silently skip if not available)
|
|
[ -n "$NVM_DIR" ] && [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" 2>/dev/null
|
|
|
|
# Load node version from .nvmrc if using nvm (silently skip if nvm not available)
|
|
[ -f .nvmrc ] && command -v nvm >/dev/null 2>&1 && nvm use >/dev/null 2>&1
|
|
|
|
# Ensure common system paths are in PATH (for systems without nvm)
|
|
# This helps find node/npm installed via Homebrew, system packages, etc.
|
|
export PATH="$PATH:/usr/local/bin:/opt/homebrew/bin:/usr/bin"
|
|
|
|
# Run lint-staged - works with or without nvm
|
|
# Prefer npx, fallback to npm exec, both work with system-installed Node.js
|
|
if command -v npx >/dev/null 2>&1; then
|
|
npx lint-staged
|
|
elif command -v npm >/dev/null 2>&1; then
|
|
npm exec -- lint-staged
|
|
else
|
|
echo "Error: Neither npx nor npm found in PATH."
|
|
echo "Please ensure Node.js is installed (via nvm, Homebrew, system package manager, etc.)"
|
|
exit 1
|
|
fi
|