dotsync 0.1.16 → 0.1.18
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/README.md +2 -0
- data/docs/images/dotsync_options.png +0 -0
- data/docs/images/dotsync_pull.png +0 -0
- data/docs/images/dotsync_push.png +0 -0
- data/docs/images/github_actions_general_workflow_permissions.png +0 -0
- 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 +3 -2
- data/docs/images/dotsync_push_apply.png +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8e9f29b4444bb3395cb499524272b6a1b4ca3071c4055970de7c4c3990ed8d29
|
|
4
|
+
data.tar.gz: 9a1e346bb050beb363cb99a5a6f1476d50523cf37bfcc1d9b8dd30038fe74403
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fbc66575cbb99d7dab60eb1d623058f2c9cc1b13648004a0b14cdaaed28c19c2a6c1f9b13454b90d4acac50566df804df946f94f7104aac0f1b0e161f2b6eb1b
|
|
7
|
+
data.tar.gz: 150d2c742dca25f35baa5e288df8a21fa3ab34b4b236769de12f2f183f2064953fbe744494a8e505886cf780ce25b71f5efd05b0967ce0966ac83484e53bf2cc
|
|
@@ -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/README.md
CHANGED
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
|
|
9
9
|
Welcome to Dotsync! This gem helps you manage and synchronize your dotfiles effortlessly. Below you'll find information on installation, usage, and some tips for getting started.
|
|
10
10
|
|
|
11
|
+

|
|
12
|
+
|
|
11
13
|
## Requirements
|
|
12
14
|
- Ruby: MRI 3.2+
|
|
13
15
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
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
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: dotsync
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.18
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- David Sáenz
|
|
@@ -272,9 +272,10 @@ files:
|
|
|
272
272
|
- Rakefile
|
|
273
273
|
- bin/console
|
|
274
274
|
- bin/setup
|
|
275
|
+
- docs/images/dotsync_options.png
|
|
275
276
|
- docs/images/dotsync_pull.png
|
|
276
277
|
- docs/images/dotsync_push.png
|
|
277
|
-
- docs/images/
|
|
278
|
+
- docs/images/github_actions_general_workflow_permissions.png
|
|
278
279
|
- dotsync.gemspec
|
|
279
280
|
- exe/dotsync
|
|
280
281
|
- lib/dotsync.rb
|
|
Binary file
|