diff --git a/twenty-cli/lib/twenty-cli/command/connect.rb b/twenty-cli/lib/twenty-cli/command/connect.rb index 3d3b170..94181e0 100644 --- a/twenty-cli/lib/twenty-cli/command/connect.rb +++ b/twenty-cli/lib/twenty-cli/command/connect.rb @@ -15,9 +15,9 @@ class Twenty::Command::Connect < Twenty::Command private def run_command(options) - Twenty::Project.new( + Twenty::Project.create( name: File.basename(Dir.getwd), path: Dir.getwd - ).save! + ) end end diff --git a/twenty-cli/lib/twenty-cli/command/disconnect.rb b/twenty-cli/lib/twenty-cli/command/disconnect.rb index 56bd904..9e73870 100644 --- a/twenty-cli/lib/twenty-cli/command/disconnect.rb +++ b/twenty-cli/lib/twenty-cli/command/disconnect.rb @@ -15,6 +15,9 @@ class Twenty::Command::Disconnect < Twenty::Command private def run_command(options) - warn "[twenty] disconnect..." + Twenty::Project + .where(path: Dir.getwd) + .first! + .destroy end end