bootic_cli 0.6.5 → 0.6.6
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d331a2e0e56f33f937627282cfe29e9b5ac7cfce1389542ef451b1983188dbc9
|
4
|
+
data.tar.gz: e9e0c324da403e79c3ad97da0bdb0c00ad91de4b1cd82bc27683fe941ecf2e0c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 00d76572ab531748bece289269e6e5dd1359ae1653fde14ab9596b603e4e68a7e18e4772a63781a4aab40a68399d3fb708eb5e2fce61773a5df18fa0b2e41c07
|
7
|
+
data.tar.gz: 6dbead30c1a94d944bb2768c829441b89ffddc215271322a5c88fefebb8ec07b7a39fa0dac60bf1726499cb2ba519b1e8c9c5603350c54c58c356a2c5bb7f080
|
@@ -31,19 +31,50 @@ module BooticCli
|
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
|
-
desc 'dev', 'Create a development theme for
|
34
|
+
desc 'dev', 'Create or delete a development theme for shop'
|
35
|
+
# option :shop, banner: '<shop_subdomain>', aliases: '-s', type: :string
|
36
|
+
option :delete, banner: '<true|false>', type: :boolean, desc: 'Deletes theme, if present'
|
35
37
|
def dev
|
36
38
|
within_theme do
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
39
|
+
# shop = theme_selector.find_remote_shop(options['shop'])
|
40
|
+
local_theme = theme_selector.select_local_theme(current_dir)
|
41
|
+
shop = theme_selector.find_remote_shop(local_theme.subdomain)
|
42
|
+
remote_theme = theme_selector.select_remote_theme(shop)
|
43
|
+
|
44
|
+
if options['delete']
|
45
|
+
if remote_theme.public?
|
46
|
+
return prompt.say("No development theme found!", :red)
|
47
|
+
end
|
48
|
+
|
49
|
+
unless prompt.yes_or_no?("Are you ABSOLUTELY sure you want to delete your development theme?", false)
|
50
|
+
return prompt.say "No worries, mate."
|
51
|
+
end
|
52
|
+
|
53
|
+
if remote_theme.delete!
|
54
|
+
prompt.say "No problem! The development theme was removed."
|
55
|
+
else
|
56
|
+
prompt.say "Whoops! Couldn't delete theme dev theme."
|
57
|
+
end
|
58
|
+
|
59
|
+
else # create
|
60
|
+
unless remote_theme.public?
|
61
|
+
return prompt.say("You already have a development theme set up!", :red)
|
62
|
+
end
|
63
|
+
|
64
|
+
unless shop.themes.can?(:create_dev_theme)
|
65
|
+
return prompt.say('Dev theme not available!')
|
66
|
+
end
|
67
|
+
|
68
|
+
result = shop.themes.create_dev_theme
|
69
|
+
if result.has?(:errors)
|
70
|
+
prompt.say "Couldn't create dev theme: #{result.errors.map(&:field).join(', ')}"
|
71
|
+
else
|
72
|
+
prompt.say "Success! You're now working on a development copy of your theme."
|
73
|
+
prompt.say "Any changes you push or sync won't appear on your public website, but on the development version (in /preview/dev)."
|
74
|
+
prompt.say "Once you're ready to merge your changes back, run the `publish` command."
|
75
|
+
end
|
41
76
|
end
|
42
77
|
|
43
|
-
local_theme = theme_selector.create_dev_theme(current_dir)
|
44
|
-
prompt.say "Success! You're now working on a development copy of your theme."
|
45
|
-
prompt.say "Any changes you push or sync won't appear on your public website, but on the development version."
|
46
|
-
prompt.say "Once you're ready to merge your changes back, run the `publish` command."
|
47
78
|
end
|
48
79
|
end
|
49
80
|
|
@@ -49,14 +49,6 @@ module BooticCli
|
|
49
49
|
theme
|
50
50
|
end
|
51
51
|
|
52
|
-
def create_dev_theme(dir)
|
53
|
-
theme = select_local_theme(dir)
|
54
|
-
shop = find_remote_shop(theme.subdomain)
|
55
|
-
raise "No shop with subdomain #{subdomain}" unless shop
|
56
|
-
raise 'Dev theme not available!' unless shop.themes.can?(:create_dev_theme)
|
57
|
-
new_theme = APITheme.new(shop.themes.create_dev_theme)
|
58
|
-
end
|
59
|
-
|
60
52
|
def select_local_theme(dir, subdomain = nil)
|
61
53
|
FSTheme.new(File.expand_path(dir), subdomain: subdomain)
|
62
54
|
end
|
data/lib/bootic_cli/version.rb
CHANGED
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.
|
4
|
+
version: 0.6.6
|
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-
|
12
|
+
date: 2019-09-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thor
|