dotsync 0.1.16 → 0.1.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/gem-push.yml +6 -0
- data/CHANGELOG.md +7 -0
- data/Gemfile.lock +1 -1
- data/exe/dotsync +4 -0
- data/lib/dotsync/actions/pull_action.rb +5 -3
- data/lib/dotsync/models/mapping.rb +6 -2
- data/lib/dotsync/utils/directory_differ.rb +2 -0
- data/lib/dotsync/utils/file_transfer.rb +6 -4
- data/lib/dotsync/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a868366d1612681fb6a8342ded8b94887e8c822fff94dbcfaecc6991efe3804b
|
|
4
|
+
data.tar.gz: efb0a01d0a6210915c019e2b133ef18c1e12fb8a0348c2151c506722089ee33e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e9f71907042f83845b11367f430581e7f91d002a0fb9ad3a7b5506bb63ac85486ad30f668597daa9a73a1f8f79b71e794e137493fd48eb84aa9d74b9e9af81c2
|
|
7
|
+
data.tar.gz: 31dbc7a701a809efd03d085b7544dfaec9ba550e5089fcabb87208a4f3e18f910d709821cf91f854769b9d7b8b1e4efeb40c0d6af40606a184301627306cd4b1
|
|
@@ -45,6 +45,12 @@ jobs:
|
|
|
45
45
|
env:
|
|
46
46
|
GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
|
|
47
47
|
|
|
48
|
+
- name: Configure Git
|
|
49
|
+
if: matrix.ruby == '3.2' && github.ref_name == 'master'
|
|
50
|
+
run: |
|
|
51
|
+
git config --local user.email "action@github.com"
|
|
52
|
+
git config --local user.name "GitHub Action"
|
|
53
|
+
|
|
48
54
|
- name: Generate release tag
|
|
49
55
|
if: matrix.ruby == '3.2' && github.ref_name == 'master'
|
|
50
56
|
run: |
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/exe/dotsync
CHANGED
|
@@ -32,6 +32,10 @@ opt_parser = OptionParser.new do |opts|
|
|
|
32
32
|
-h, --help Show this help message
|
|
33
33
|
BANNER
|
|
34
34
|
|
|
35
|
+
opts.on("-a", "--apply", "Apply changes") do
|
|
36
|
+
options[:apply] = true
|
|
37
|
+
end
|
|
38
|
+
|
|
35
39
|
opts.on("-q", "--quiet", "Hide all non-essential output (only errors or final status)") do
|
|
36
40
|
options[:quiet] = true
|
|
37
41
|
end
|
|
@@ -130,6 +130,10 @@ module Dotsync
|
|
|
130
130
|
ignores.any? { |ignore| path.start_with?(ignore) }
|
|
131
131
|
end
|
|
132
132
|
|
|
133
|
+
def skip?(path)
|
|
134
|
+
ignore?(path) || !include?(path)
|
|
135
|
+
end
|
|
136
|
+
|
|
133
137
|
private
|
|
134
138
|
def has_ignores?
|
|
135
139
|
@original_ignores.any?
|
|
@@ -145,8 +149,8 @@ module Dotsync
|
|
|
145
149
|
sanitized_ignores = raw_ignores.flat_map do |path|
|
|
146
150
|
[File.join(sanitized_src, path), File.join(sanitized_dest, path)]
|
|
147
151
|
end
|
|
148
|
-
sanitized_only = raw_only.
|
|
149
|
-
File.join(sanitized_src, path)
|
|
152
|
+
sanitized_only = raw_only.flat_map do |path|
|
|
153
|
+
[File.join(sanitized_src, path), File.join(sanitized_dest, path)]
|
|
150
154
|
end
|
|
151
155
|
[sanitized_src, sanitized_dest, sanitized_ignores, sanitized_only]
|
|
152
156
|
end
|
|
@@ -22,7 +22,7 @@ module Dotsync
|
|
|
22
22
|
if File.file?(@src)
|
|
23
23
|
transfer_file(@src, @dest)
|
|
24
24
|
else
|
|
25
|
-
cleanup_folder(@dest
|
|
25
|
+
cleanup_folder(@dest) if @force
|
|
26
26
|
transfer_folder(@src, @dest)
|
|
27
27
|
end
|
|
28
28
|
end
|
|
@@ -46,6 +46,9 @@ module Dotsync
|
|
|
46
46
|
next if [".", ".."].include?(File.basename(path))
|
|
47
47
|
|
|
48
48
|
full_path = File.expand_path(path)
|
|
49
|
+
# puts full_path
|
|
50
|
+
# require 'debug'; binding.b if full_path.include?("file6.txt")
|
|
51
|
+
# require 'debug'; binding.b if full_path.include?("sub2folder2")
|
|
49
52
|
next unless mapping.bidirectional_include?(full_path)
|
|
50
53
|
next if mapping.ignore?(full_path)
|
|
51
54
|
|
|
@@ -58,8 +61,7 @@ module Dotsync
|
|
|
58
61
|
end
|
|
59
62
|
end
|
|
60
63
|
|
|
61
|
-
def cleanup_folder(target_dir
|
|
62
|
-
exclusions = exclusions.map { |ex| File.expand_path(ex) }
|
|
64
|
+
def cleanup_folder(target_dir)
|
|
63
65
|
target_dir = File.expand_path(target_dir)
|
|
64
66
|
|
|
65
67
|
# The `Find.find` method in Ruby performs a depth-first traversal of the
|
|
@@ -72,7 +74,7 @@ module Dotsync
|
|
|
72
74
|
Find.find(target_dir) do |path|
|
|
73
75
|
next if path == target_dir
|
|
74
76
|
abs_path = File.expand_path(path)
|
|
75
|
-
if
|
|
77
|
+
if @mapping.ignore?(abs_path)
|
|
76
78
|
Find.prune if File.directory?(path)
|
|
77
79
|
next
|
|
78
80
|
end
|
data/lib/dotsync/version.rb
CHANGED