46 lines
1.2 KiB
Bash
Executable File
46 lines
1.2 KiB
Bash
Executable File
#!/bin/bash
|
|
cd "$(dirname "$0")"
|
|
|
|
# Handle commands
|
|
case "$1" in
|
|
upgrade)
|
|
echo "Upgrading Sarthi Lab..."
|
|
|
|
# Check if git is available
|
|
if ! command -v git &> /dev/null; then
|
|
echo "Error: git is not installed. Please install git first."
|
|
exit 1
|
|
fi
|
|
|
|
# Pull latest changes
|
|
echo "Pulling latest changes from repository..."
|
|
git pull
|
|
|
|
# Install/update dependencies
|
|
echo "Installing/updating dependencies..."
|
|
npm install
|
|
|
|
echo "Upgrade complete! Starting Sarthi Lab..."
|
|
npm run dev
|
|
exit 0
|
|
;;
|
|
--help|-h)
|
|
echo "Sarthi Lab Launcher"
|
|
echo "Usage: sarthi-lab [command]"
|
|
echo ""
|
|
echo "Commands:"
|
|
echo " (no command) Start Sarthi Lab (npm run dev)"
|
|
echo " upgrade Pull latest git changes and update dependencies"
|
|
echo " --help, -h Show this help"
|
|
echo " --version, -v Show version"
|
|
exit 0
|
|
;;
|
|
--version|-v)
|
|
echo "Sarthi Lab $(node -p "require('./package.json').version")"
|
|
exit 0
|
|
;;
|
|
esac
|
|
|
|
# Normal launch
|
|
echo "Starting Sarthi Lab..."
|
|
npm run dev |