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
|
private
|
||||||
|
|
||||||
def run_command(options)
|
def run_command(options)
|
||||||
|
require "twenty/server/model"
|
||||||
path = File.realpath(options.path ? options.path : Dir.getwd)
|
path = File.realpath(options.path ? options.path : Dir.getwd)
|
||||||
if File.exist?(path)
|
if File.exist?(path)
|
||||||
project = Twenty::Project.create(
|
project = Twenty::Project.create(
|
||||||
|
|
|
@ -24,6 +24,7 @@ class Twenty::Command::Console < Twenty::Command
|
||||||
private
|
private
|
||||||
|
|
||||||
def run_command(options)
|
def run_command(options)
|
||||||
|
require "twenty/server/model"
|
||||||
require "irb"
|
require "irb"
|
||||||
TOPLEVEL_BINDING.irb
|
TOPLEVEL_BINDING.irb
|
||||||
end
|
end
|
||||||
|
|
|
@ -19,6 +19,7 @@ class Twenty::Command::Disconnect < Twenty::Command
|
||||||
private
|
private
|
||||||
|
|
||||||
def run_command(options)
|
def run_command(options)
|
||||||
|
require "twenty/server/model"
|
||||||
path = File.realpath(options.path ? options.path : Dir.getwd)
|
path = File.realpath(options.path ? options.path : Dir.getwd)
|
||||||
Twenty::Project
|
Twenty::Project
|
||||||
.where(path:)
|
.where(path:)
|
||||||
|
|
|
@ -36,6 +36,7 @@ class Twenty::Command::Up < Twenty::Command
|
||||||
private
|
private
|
||||||
|
|
||||||
def run_command(options)
|
def run_command(options)
|
||||||
|
require "twenty/server/model"
|
||||||
File.binwrite(pid, Process.pid.to_s)
|
File.binwrite(pid, Process.pid.to_s)
|
||||||
thr = Twenty::Rack.server(options).start
|
thr = Twenty::Rack.server(options).start
|
||||||
thr.join
|
thr.join
|
||||||
|
|
Loading…
Reference in a new issue