summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lua/rclone.lua12
1 files changed, 11 insertions, 1 deletions
diff --git a/lua/rclone.lua b/lua/rclone.lua
index 3685222..4403fee 100644
--- a/lua/rclone.lua
+++ b/lua/rclone.lua
@@ -27,7 +27,17 @@ local function find_config_file()
--if current_dir:is_root() then
if current_dir.filename == '/' then
- return ''
+ -- set to 'rclone config file' output
+ local handle = io.popen('rclone config file', 'r')
+ handle:read() -- advance one line because we want the second line only
+ local output = handle:read();
+ handle:close()
+
+ config_file = output
+ local config_file_path = Path:new(config_file)
+ config_dir = config_file_path:parent().filename
+
+ return config_file
end
current_dir = current_dir:parent()