dolphins7.skeleton/twenty-cli/bin/twenty

36 lines
1,016 B
Text
Raw Normal View History

#!/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-26 03:12:57 +01:00
when "console"
wait spawn("console", *ARGV[1..])
exit $?.exitstatus
2023-12-08 14:40:42 +01:00
else
2024-03-11 18:45:11 +01:00
warn "Usage: twenty COMMAND [OPTIONS]\n\n" \
2023-12-08 14:40:42 +01:00
"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-26 03:12:57 +01:00
" console Start the twenty developer console.\n" \
2023-12-08 14:40:42 +01:00
end