bootic_cli 0.9.4 → 0.9.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a296e4252d391af00cccfff4af93d652c2daa29e4b8d65cd42202331bfc1b70d
4
- data.tar.gz: 2f485bdd0c668f84738a21d7872404180ebaf04f594d37b1e000bc5df1966f52
3
+ metadata.gz: 4e9689455a4845de27825aa295f27f84c1e45035bbb350413f85f171a26e4bd0
4
+ data.tar.gz: ce296652260b9f18af912d636272b6df039be1207584c2b6d619ecfd3cfb1331
5
5
  SHA512:
6
- metadata.gz: 8d44a11d8d69d2bd619cd69b8f9e8cfcaf42eea3674f6281cc14c9d70f74c1660da618f4b07983a034ac2d23534e380d83f485946705c641032af12feaa4c835
7
- data.tar.gz: 6ad0e38e1b4274e68cc52c9d987f0b126af1d786707d2962d82b719bbc158ad4bb8bfba7efe3b1e63bf59ae05cd27e35753ccadea3c09deceeeceb0e735bb546
6
+ metadata.gz: e3b44f183224b102820bc1f8a4f200d43d277fb385e973d5a792144cda1cc16ea852209c084d364436226dd72a7b377f444e4c9e6aecf70dcf9abe8618367756
7
+ data.tar.gz: 855814910c7e021eee1386a2fc1fea56384fd8dad25eead5d4438be5824ff0a9afaecd51c8d3c7ae439d049e17c43eabfd1fc3a49ca5a6527f11d1ce40dcd760
@@ -147,6 +147,8 @@ module BooticCli
147
147
 
148
148
  diff = BooticCli::Themes::ThemeDiff.new(source: local_theme, target: remote_theme)
149
149
  if diff.any?
150
+ # puts diff.summary
151
+
150
152
  if prompt.yes_or_no?("There are differences between the remote theme and your local copy. Sync now?", true)
151
153
  workflows.sync(local_theme, remote_theme)
152
154
  prompt.say "Synced!", :cyan
@@ -30,7 +30,7 @@ module BooticCli
30
30
  end
31
31
 
32
32
  ASSETS_DIR = 'assets'.freeze
33
- TEMPLATE_PATTERNS = ['sections/*.html', '*.html', '*.css', '*.js', '*.json', 'theme.yml'].freeze
33
+ TEMPLATE_PATTERNS = ['sections/*.html', '*.html', '*.css', '*.js', '*.json', '*.yml'].freeze
34
34
  ASSET_PATTERNS = [File.join(ASSETS_DIR, '*')].freeze
35
35
 
36
36
  ASSET_PATH_REGEX = /^assets\/[^\/]+$/.freeze
@@ -9,6 +9,10 @@ module BooticCli
9
9
  templates.any? || assets.any?
10
10
  end
11
11
 
12
+ def count
13
+ templates.count + assets.count
14
+ end
15
+
12
16
  def templates
13
17
  @templates ||= find_missing_files(source.templates, target.templates)
14
18
  end
@@ -9,6 +9,16 @@ module BooticCli
9
9
  @force_update = force_update
10
10
  end
11
11
 
12
+ def summary
13
+ msg = []
14
+ msg.push(" - Updated in source: #{updated_in_source.count}") if updated_in_source.any?
15
+ msg.push(" - Updated in target: #{updated_in_target.count}") if updated_in_target.any?
16
+ msg.push(" - Missing in target: #{missing_in_target.count}") if missing_in_target.any?
17
+ msg.push(" - Missing in source: #{missing_in_source.count}") if missing_in_source.any?
18
+ msg.unshift("Summary:") if msg.any?
19
+ msg.join("\n")
20
+ end
21
+
12
22
  def any?
13
23
  updated_in_source.any? || updated_in_target.any? || missing_in_target.any? || missing_in_source.any?
14
24
  end
@@ -28,6 +28,10 @@ module BooticCli
28
28
  templates.any? # || assets.any?
29
29
  end
30
30
 
31
+ def count
32
+ templates.count
33
+ end
34
+
31
35
  def templates
32
36
  @templates ||= map_pair(source.templates, target.templates) do |a, b|
33
37
  diff = Diffy::Diff.new(normalize_endings(b.body), normalize_endings(a.body), context: 1)
@@ -168,6 +168,8 @@ module BooticCli
168
168
  changes = ThemeDiff.new(source: local_theme, target: remote_theme)
169
169
  if changes.any?
170
170
  prompt.say "There are differences between your local and the remote version of your shop's development theme."
171
+ puts changes.summary
172
+
171
173
  if prompt.yes_or_no? "Push your local changes now?", true
172
174
  push(local_theme, remote_theme, delete: true)
173
175
  else
@@ -327,7 +329,7 @@ module BooticCli
327
329
 
328
330
  item, type = FSTheme.resolve_file(path, dir)
329
331
  unless item
330
- # puts "Not a template or asset: #{path}"
332
+ puts "Not a template or asset: #{path}"
331
333
  return
332
334
  end
333
335
 
@@ -1,3 +1,3 @@
1
1
  module BooticCli
2
- VERSION = '0.9.4'
2
+ VERSION = '0.9.5'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bootic_cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.4
4
+ version: 0.9.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ismael Celis
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-05-05 00:00:00.000000000 Z
12
+ date: 2023-06-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor