2023-12-07 11:18:16 +01:00
|
|
|
#!/usr/bin/env ruby
|
2023-12-08 14:40:42 +01:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
libdir = File.join(__dir__, "..", "lib")
|
2023-12-09 22:46:13 +01:00
|
|
|
require File.join(libdir, "twenty-cli", "libexec")
|
2023-12-08 14:40:42 +01:00
|
|
|
|
|
|
|
case ARGV[0]
|
|
|
|
when "up"
|
|
|
|
wait spawn("up", *ARGV[1..])
|
|
|
|
exit $?.exitstatus
|
|
|
|
when "down"
|
|
|
|
wait spawn("down", *ARGV[1..])
|
|
|
|
exit $?.exitstatus
|
2023-12-08 19:27:00 +01:00
|
|
|
when "connect"
|
|
|
|
wait spawn("connect", *ARGV[1..])
|
|
|
|
exit $?.exitstatus
|
|
|
|
when "disconnect"
|
|
|
|
wait spawn("disconnect", *ARGV[1..])
|
|
|
|
exit $?.exitstatus
|
2023-12-23 20:02:16 +01:00
|
|
|
when "migrate"
|
|
|
|
wait spawn("migrate", *ARGV[1..])
|
|
|
|
exit $?.exitstatus
|
2023-12-08 14:40:42 +01:00
|
|
|
else
|
|
|
|
warn "Usage: twenty COMMAND [OPTIONS]\n\n" \
|
|
|
|
"Commands:\n" \
|
|
|
|
" up Start the twenty web server.\n" \
|
|
|
|
" down Stop the twenty web server.\n" \
|
2023-12-08 19:27:00 +01:00
|
|
|
" connect Connect a project to twenty.\n" \
|
2023-12-23 20:02:16 +01:00
|
|
|
" disconnect Disconnect a project from twenty.\n" \
|
|
|
|
" migrate Migrate the database.\n" \
|
2023-12-08 14:40:42 +01:00
|
|
|
end
|