27 lines
752 B
Ruby
Executable file
27 lines
752 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
|
|
else
|
|
warn "Usage: twenty 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"
|
|
end
|