From 19f29796259113c4e28588416cb45b9b677fffef Mon Sep 17 00:00:00 2001 From: rhjdvsgsgks <26178113+rhjdvsgsgks@users.noreply.github.com> Date: Sat, 18 Jun 2022 20:56:46 +0000 Subject: [PATCH 1/2] fix cli init (1/2) already become a `LocalPathname` when init (line 157) --- lib/snapsync/cli.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/snapsync/cli.rb b/lib/snapsync/cli.rb index 4920de6..55da9ab 100644 --- a/lib/snapsync/cli.rb +++ b/lib/snapsync/cli.rb @@ -214,7 +214,7 @@ def init(*args) option :config_file, default: '/etc/snapsync.conf', desc: 'the configuration file that should be updated' def auto_add(name, dir) - uuid, mountpoint, relative = partition_of(Snapsync::path(dir)) + uuid, mountpoint, relative = partition_of(dir) conf_path = Pathname.new(options[:config_file]) autosync = AutoSync.new snapsync_config_file: conf_path From 14f6371a1e6401106cd7927d5ee8c038f71a829e Mon Sep 17 00:00:00 2001 From: rhjdvsgsgks <26178113+rhjdvsgsgks@users.noreply.github.com> Date: Sat, 18 Jun 2022 20:59:51 +0000 Subject: [PATCH 2/2] fix cli init (2/2) use dbus when local --- lib/snapsync/partitions_monitor.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/snapsync/partitions_monitor.rb b/lib/snapsync/partitions_monitor.rb index 6653643..b62d8a6 100644 --- a/lib/snapsync/partitions_monitor.rb +++ b/lib/snapsync/partitions_monitor.rb @@ -14,7 +14,7 @@ class PartitionsMonitor # @param [RemotePathname] machine Remote machine to connect to def initialize(machine = nil) - if machine.nil? + if machine.nil? | machine.is_a?(LocalPathname) dbus = DBus::SystemBus.instance else sock_path = '/tmp/snapsync_%04d_remote.sock' % rand(10000)