Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the Unison 'Name' prefix for default ignores #820

Merged
merged 1 commit into from
Sep 13, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion lib/docker-sync/sync_strategy/unison.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,16 @@ def expand_ignore_strings
exclude_type = 'Name'
exclude_type = @options['sync_excludes_type'] unless @options['sync_excludes_type'].nil?

# use the 'Name' exclude type for all default ignores
# to prevent conflicts with the sync_excludes_type settings
unless Environment.default_ignores.nil?
expanded_ignore_strings = Environment.default_ignores.map do |pattern|
"-ignore='Name #{pattern}'"
end
end

unless @options['sync_excludes'].nil?
expanded_ignore_strings = @options['sync_excludes'].append(Environment.default_ignores).flatten!.map do |pattern|
expanded_ignore_strings = @options['sync_excludes'].map do |pattern|
ignore_string = if exclude_type == 'none'
# the ignore type like Name / Path are part of the pattern
pattern.to_s
Expand Down