diff options
author | Daniel Weipert <code@drogueronin.de> | 2022-01-22 14:30:05 +0100 |
---|---|---|
committer | Daniel Weipert <code@drogueronin.de> | 2022-01-22 14:30:05 +0100 |
commit | bebc9657356d49a22ab9de723d4c3b40f68fa09e (patch) | |
tree | 15bc849c8bdef93d901797a3cccfc94b251d36a4 | |
parent | 0cfa05d71fb4a9bff42aaa33eacd67782543c54a (diff) |
Add global gitignore to exclude files
-rw-r--r-- | lua/rclone.lua | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lua/rclone.lua b/lua/rclone.lua index fe0b85a..ae37188 100644 --- a/lua/rclone.lua +++ b/lua/rclone.lua @@ -181,6 +181,13 @@ local function build_cmd_exclude(local_path) cmd = cmd .. ' --exclude-from=' .. gitignore.filename end + local handle = io.popen('git config --get core.excludesfile', 'r') + local gitignore_global = Path:new((Path:new(handle:read())):expand()) + handle:close() + if gitignore_global:exists() then + cmd = cmd .. ' --exclude-from=' .. gitignore_global.filename + end + -- add .rcloneignore patterns local rcloneignore = Path:new(local_path .. '/.rcloneignore') if rcloneignore:exists() then |