bootic_cli 0.6.0 → 0.6.1

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: def2df2eed49539b45547161ee455656398f20b8796eb80b299976f303deb96b
4
- data.tar.gz: 65c4fe5a6d0a41d0327dc461bddfc0e5c5335681152243481d800dd88fd0b07b
3
+ metadata.gz: 5c70dee5796feb738f8649d42d711deab4d584174a3e711b72b1cbbf1b7fbf1d
4
+ data.tar.gz: 591b4080c30abc76ead069bd437fd3046c752ff83d3934bc3fd3cee61dd094b4
5
5
  SHA512:
6
- metadata.gz: e02f380074ef425d08187cd0daa9fe12f5e6ef435e8cfa5fc4385ba07b9278e288b9de4ce9e79c8c53fd61a80deca6078ea58e8a131a792dd1f160becaea7e2a
7
- data.tar.gz: 1bf4e225d6c5339bf31fa570f44542ca67ca933f07edbcdca15f13cfaa1d4d2f9faf74439a61da36bc552c6ef34c2034a627a19647f926dae938eff5a949a4b1
6
+ metadata.gz: 3edf369d283f4d79909a8e77b3b7d1911e38c4e1c4f326c2fea089eb5f26f5dc307560844d9fbf6cf7fd82b9aa55c69e87e4fa5bc951b79c875bd33b108fe779
7
+ data.tar.gz: 5da2f658f1dd9611ad61043a3a33aca12e0cec0c3c51f355d5818ddfb54ea16f89e4d6fd81e89f32537489199e327c024db888df192c758de7921c03e1d90386
@@ -89,6 +89,7 @@ module BooticCli
89
89
 
90
90
  # if we just compared against the dev theme, redo the mumbo-jumbo but with the public one
91
91
  unless remote_theme.public?
92
+ prompt.say "Comparing againt public theme now.", :cyan
92
93
  local_theme, public_theme = theme_selector.select_theme_pair(default_subdomain, current_dir, true)
93
94
  workflows.compare(local_theme, public_theme)
94
95
  end
@@ -150,21 +151,43 @@ module BooticCli
150
151
  end
151
152
  end
152
153
 
153
- desc 'open', 'Open theme preview URL in a browser'
154
- option :public, banner: '<true|false>', type: :boolean, aliases: '-p', desc: 'Opens public theme URL'
155
- def open
156
- within_theme do
157
- _, remote_theme = theme_selector.select_theme_pair(default_subdomain, current_dir, options['public'])
158
- Launchy.open remote_theme.path
159
- end
160
- end
154
+ # desc 'open', 'Open theme preview URL in a browser'
155
+ # option :public, banner: '<true|false>', type: :boolean, aliases: '-p', desc: 'Opens public theme URL'
156
+ # def open
157
+ # within_theme do
158
+ # _, remote_theme = theme_selector.select_theme_pair(default_subdomain, current_dir, options['public'])
159
+ # Launchy.open remote_theme.path
160
+ # end
161
+ # end
161
162
 
162
163
  desc 'pair', 'Pair this directory to remote [shop]'
163
164
  option :shop, banner: '<shop_subdomain>', type: :string, required: true
164
165
  def pair
165
166
  within_theme do
166
167
  local_theme = theme_selector.pair(options['shop'], current_dir)
167
- prompt.say "Directory #{local_theme.path} paired with shop #{options['shop']}", :green
168
+ prompt.say "Directory #{File.dirname(local_theme.path)} paired with shop #{options['shop']}", :green
169
+ end
170
+ end
171
+
172
+ desc 'local_pull [from_path]', 'Pull changes from a local (parent) theme into current one'
173
+ # option :path, banner: '<path>', type: :string, required: true
174
+ option :delete, banner: '<true|false>', type: :boolean, desc: 'Remove local files that were removed in parent theme (default: false)'
175
+ def local_pull(dir)
176
+ within_theme do
177
+ unless File.directory?(dir) and contains_theme?(dir)
178
+ prompt.say("Path doesn't exist or doesn't contain theme: #{dir}")
179
+ abort
180
+ end
181
+
182
+ dirname = File.dirname(dir)
183
+ local_theme = theme_selector.select_local_theme(current_dir)
184
+ parent_theme = theme_selector.select_local_theme(dir)
185
+
186
+ prompt.say "Pulling changes from parent theme at #{dirname}", :green
187
+ delete_removed = options['delete'].nil? ? false : options['delete']
188
+ workflows.pull(local_theme, parent_theme, delete: delete_removed)
189
+
190
+ prompt.say "Synced changes from parent theme at #{dirname} with local one.", :cyan
168
191
  end
169
192
  end
170
193
 
@@ -188,8 +211,12 @@ module BooticCli
188
211
  end
189
212
  end
190
213
 
214
+ def contains_theme?(path)
215
+ File.exist?(File.join(path, 'layout.html'))
216
+ end
217
+
191
218
  def is_within_theme?
192
- File.exist?(File.join(current_expanded_dir, 'layout.html'))
219
+ contains_theme?(current_expanded_dir)
193
220
  end
194
221
 
195
222
  def current_dir
@@ -1,3 +1,3 @@
1
1
  module BooticCli
2
- VERSION = "0.6.0"
2
+ VERSION = "0.6.1"
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.6.0
4
+ version: 0.6.1
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: 2019-01-30 00:00:00.000000000 Z
12
+ date: 2019-02-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor