From be3d6602313286d786fd452cdf2f77522873c5c9 Mon Sep 17 00:00:00 2001 From: Ryan Cox Date: Wed, 17 Jul 2024 11:32:02 -0600 Subject: [PATCH] exclude vim swp files from rsync (#3677) vim swp files can be unreadable to users, especially if editing when opened with vim -R as root. This causes the rsync to fail. Excluding .*.swp files fixes that issue. --- apps/dashboard/app/models/batch_connect/session.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/dashboard/app/models/batch_connect/session.rb b/apps/dashboard/app/models/batch_connect/session.rb index fefa6dd108..0d34a71996 100644 --- a/apps/dashboard/app/models/batch_connect/session.rb +++ b/apps/dashboard/app/models/batch_connect/session.rb @@ -278,7 +278,7 @@ def stage(root, context: nil) staged_root.tap { |p| FileUtils.mkdir_p(p.to_s, mode: 0o0700) unless p.exist? } # Sync the template files over - oe, s = Open3.capture2e('rsync', '-rlpv', '--exclude', '*.erb', "#{root}/", staged_root.to_s) + oe, s = Open3.capture2e('rsync', '-rlpv', '--exclude', '.*.swp', '--exclude', '*.erb', "#{root}/", staged_root.to_s) raise oe unless s.success? # Output user submitted context attributes for debugging purposes