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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 653f18b457e91c025888eb6fca1d14de2718aa0ee7253c30d80e699c6fdc720a
4
- data.tar.gz: 9c180933f5b35c186fbfaf754a38a9217fcdd459fae3c75d67787d43516f3871
3
+ metadata.gz: a868366d1612681fb6a8342ded8b94887e8c822fff94dbcfaecc6991efe3804b
4
+ data.tar.gz: efb0a01d0a6210915c019e2b133ef18c1e12fb8a0348c2151c506722089ee33e
5
5
  SHA512:
6
- metadata.gz: 0aedae57228a61723b3f4f929e64387dce6fbc227d2f9d68271512eafa7ff15c7ac780fc0f2be80b60868266f309d52403b0ea24d7222770f5ce16edce102df9
7
- data.tar.gz: 19cb8d65ba7216aa1e2577eb77876a363267e1f7a73f5b5c7dd9ce26c4490988613d30be2199e1580971ac10c45515f86d145bd6565b98edd6d0035dacd352c5
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
@@ -1,3 +1,10 @@
1
+ # 0.1.17
2
+
3
+ - Fixes skipped files
4
+ - FileTransfer: fixes options
5
+ - GithubActions: fixes generate release tag
6
+ - Avoid backup without no difference
7
+
1
8
  # 0.1.16
2
9
 
3
10
  - DirectoryDiffer: fixes path on removal difference
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dotsync (0.1.16)
4
+ dotsync (0.1.17)
5
5
  fileutils (~> 1.7.3)
6
6
  find (~> 0.2.0)
7
7
  listen (~> 3.9.0)
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
@@ -19,9 +19,11 @@ module Dotsync
19
19
 
20
20
  return unless options[:apply]
21
21
 
22
- if create_backup
23
- show_backup
24
- purge_old_backups
22
+ if has_differences?
23
+ if create_backup
24
+ show_backup
25
+ purge_old_backups
26
+ end
25
27
  end
26
28
 
27
29
  transfer_mappings
@@ -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.map do |path|
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
@@ -59,6 +59,8 @@ module Dotsync
59
59
 
60
60
  src_path = File.join(mapping_src, rel_path)
61
61
 
62
+ next if @mapping.skip?(src_path)
63
+
62
64
  if !File.exist?(src_path)
63
65
  removals << rel_path
64
66
  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, @ignores) if @force
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, exclusions = [])
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 exclusions.any? { |ex| abs_path.start_with?(ex) }
77
+ if @mapping.ignore?(abs_path)
76
78
  Find.prune if File.directory?(path)
77
79
  next
78
80
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dotsync
4
- VERSION = "0.1.16"
4
+ VERSION = "0.1.17"
5
5
  end
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.16
4
+ version: 0.1.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Sáenz