From 68e25ac8c70cec6377deb0c8ced4c450c03e4e79 Mon Sep 17 00:00:00 2001 From: 0x1eef <0x1eef@protonmail.com> Date: Thu, 28 Mar 2024 15:26:52 -0300 Subject: [PATCH] Fix 'twenty connect|disconnect' --- twenty-cli/lib/twenty-cli/command/connect.rb | 4 ++-- twenty-cli/lib/twenty-cli/command/disconnect.rb | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) 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