Browse Source

Show help as fallback

umbrel-beta
Luke Childs 5 years ago
parent
commit
0d7058b900
  1. 29
      umbrel-dev

29
umbrel-dev

@ -40,48 +40,53 @@ run() {
vagrant ssh -c "cd /vagrant/getumbrel/umbrel && $1" vagrant ssh -c "cd /vagrant/getumbrel/umbrel && $1"
} }
# Show help text if no args set or help is called
if [[ -z ${1+x} ]] || [[ "$1" = "help" ]]; then
show_help
exit 1
fi
# Check deps before running any commands # Check deps before running any commands
check_dependencies check_dependencies
if [ -z ${1+x} ]; then
command=""
else
command="$1"
fi
# Initialize an Umbrel development environment in the working directory # Initialize an Umbrel development environment in the working directory
if [[ "$1" = "init" ]]; then if [[ "$command" = "init" ]]; then
mkdir getumbrel mkdir getumbrel
git clone https://github.com/getumbrel/umbrel.git getumbrel/umbrel git clone https://github.com/getumbrel/umbrel.git getumbrel/umbrel
exit exit
fi fi
# Boot the development VM # Boot the development VM
if [[ "$1" = "boot" ]]; then if [[ "$command" = "boot" ]]; then
vagrant up vagrant up
exit exit
fi fi
# Halt the development VM # Halt the development VM
if [[ "$1" = "halt" ]]; then if [[ "$command" = "halt" ]]; then
vagrant halt vagrant halt
exit exit
fi fi
# Destroy the development VM # Destroy the development VM
if [[ "$1" = "destroy" ]]; then if [[ "$command" = "destroy" ]]; then
vagrant destroy vagrant destroy
exit exit
fi fi
# Run a command inside the development VM # Run a command inside the development VM
if [[ "$1" = "run" ]]; then if [[ "$command" = "run" ]]; then
run "$2" run "$2"
exit exit
fi fi
# Get an SSH session inside the development VM # Get an SSH session inside the development VM
if [[ "$1" = "ssh" ]]; then if [[ "$command" = "ssh" ]]; then
run bash run bash
exit exit
fi fi
# If we get here it means no valid command was supplied
# Show help and exit
show_help
exit 1

Loading…
Cancel
Save