Init model (when neccessary)
This commit is contained in:
parent
47aaecc483
commit
e24f7a0690
4 changed files with 4 additions and 0 deletions
|
@ -21,6 +21,7 @@ class Twenty::Command::Connect < Twenty::Command
|
|||
private
|
||||
|
||||
def run_command(options)
|
||||
require "twenty/server/model"
|
||||
path = File.realpath(options.path ? options.path : Dir.getwd)
|
||||
if File.exist?(path)
|
||||
project = Twenty::Project.create(
|
||||
|
|
|
@ -24,6 +24,7 @@ class Twenty::Command::Console < Twenty::Command
|
|||
private
|
||||
|
||||
def run_command(options)
|
||||
require "twenty/server/model"
|
||||
require "irb"
|
||||
TOPLEVEL_BINDING.irb
|
||||
end
|
||||
|
|
|
@ -19,6 +19,7 @@ class Twenty::Command::Disconnect < Twenty::Command
|
|||
private
|
||||
|
||||
def run_command(options)
|
||||
require "twenty/server/model"
|
||||
path = File.realpath(options.path ? options.path : Dir.getwd)
|
||||
Twenty::Project
|
||||
.where(path:)
|
||||
|
|
|
@ -36,6 +36,7 @@ class Twenty::Command::Up < Twenty::Command
|
|||
private
|
||||
|
||||
def run_command(options)
|
||||
require "twenty/server/model"
|
||||
File.binwrite(pid, Process.pid.to_s)
|
||||
thr = Twenty::Rack.server(options).start
|
||||
thr.join
|
||||
|
|
Loading…
Reference in a new issue