diff options
Diffstat (limited to 'lua/rclone.lua')
-rw-r--r-- | lua/rclone.lua | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/lua/rclone.lua b/lua/rclone.lua index 0f94916..df7aec6 100644 --- a/lua/rclone.lua +++ b/lua/rclone.lua @@ -152,6 +152,23 @@ local function build_cmd_remote_path(config, remote) end --- +-- Add local mount path +-- +-- @param local_path string +-- @param options table +-- @param config table +-- +-- @return string +local function build_cmd_local_mount_path(local_path, options, config) + local mount_directory = options['directory'] or + config.vim_rclone_mount_directory or + vim.g.vim_rclone_mount_directory or + 'rclone.mount' + + return local_path .. '/' .. mount_directory +end + +--- -- Add config location path -- -- @return string @@ -441,12 +458,7 @@ local function mount(options) local local_path = prepare_cmd_local_path(config) local remote_path = build_cmd_remote_path(config, remote) - - local mount_directory = options['directory'] or - config.vim_rclone_mount_directory or - vim.g.vim_rclone_mount_directory or - 'rclone.mount' - local local_mount_path = local_path .. '/' .. mount_directory + local local_mount_path = build_cmd_local_mount_path(local_path, options, config) local cmd = 'rclone mount ' .. |