Merge branch 'main' into colorable-models

This commit is contained in:
0x1eef 2024-01-09 05:24:09 -03:00
commit f3becdf57b
5 changed files with 17 additions and 5 deletions

View file

@ -5,6 +5,7 @@ require "cmd"
class Twenty::Command < Cmd
##
# mixins
require_relative "command/mixin/common_option_mixin"
require_relative "command/mixin/pending_migration_mixin"
require_relative "command/mixin/sqlite_connection_mixin"

View file

@ -3,6 +3,7 @@
class Twenty::Command::Console < Twenty::Command
set_banner usage: "twenty console [OPTIONS]",
description: "Start the twenty developer console"
include CommonOptionMixin
prepend Twenty::Command::PendingMigrationMixin
prepend Twenty::Command::SQLiteConnectionMixin

View file

@ -3,6 +3,7 @@
class Twenty::Command::Migrate < Twenty::Command
set_banner usage: "twenty migrate [OPTIONS]",
description: "Migrate the database"
include CommonOptionMixin
prepend Twenty::Command::SQLiteConnectionMixin
def run

View file

@ -0,0 +1,13 @@
class Twenty::Command
module CommonOptionMixin
def self.included(mod)
mod.module_eval do
set_option "-d PATH",
"--database PATH",
"The path to an alternate SQLite3 database",
as: String,
default: nil
end
end
end
end

View file

@ -3,11 +3,7 @@
class Twenty::Command::Up < Twenty::Command
set_banner usage: "twenty up [OPTIONS]",
description: "Start the twenty web server"
set_option "-d PATH",
"--database PATH",
"The path to an alternate SQLite3 database",
as: String,
default: nil
include CommonOptionMixin
prepend Twenty::Command::PendingMigrationMixin
prepend Twenty::Command::SQLiteConnectionMixin