dolphins7.skeleton/twenty-cli/bin/twenty

35 lines
1,012 B
Ruby
Executable file

#!/usr/bin/env ruby
# frozen_string_literal: true
libdir = File.join(__dir__, "..", "lib")
require File.join(libdir, "twenty-cli", "libexec")
case ARGV[0]
when "up"
wait spawn("up", *ARGV[1..])
exit $?.exitstatus
when "down"
wait spawn("down", *ARGV[1..])
exit $?.exitstatus
when "connect"
wait spawn("connect", *ARGV[1..])
exit $?.exitstatus
when "disconnect"
wait spawn("disconnect", *ARGV[1..])
exit $?.exitstatus
when "migrate"
wait spawn("migrate", *ARGV[1..])
exit $?.exitstatus
when "console"
wait spawn("console", *ARGV[1..])
exit $?.exitstatus
else
warn "Usage: 20 COMMAND [OPTIONS]\n\n" \
"Commands:\n" \
" up Start the twenty web server.\n" \
" down Stop the twenty web server.\n" \
" connect Connect a project to twenty.\n" \
" disconnect Disconnect a project from twenty.\n" \
" migrate Migrate the database.\n" \
" console Start the twenty developer console.\n" \
end