bootic_cli 0.5.1 → 0.5.2

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
  SHA1:
3
- metadata.gz: 6d23940a740e8d8427e4eccf0f5bb872a19d9470
4
- data.tar.gz: fb069df631666e1f2771f5d3fc4455a4c8b1dc0a
3
+ metadata.gz: a5127d49dc387636714e2b3a9cbc724d3c240fc8
4
+ data.tar.gz: 7bd10ce8519aa573ecd6aa0af7dffc900e3b7970
5
5
  SHA512:
6
- metadata.gz: 5a65fbc81c21cefc4fdbbcd74002970541db887fccdcded111f0fa607246ea1e8293b4758c821c674b2e9db2b919cba85cf68d856eebf3bd2d5cf5a726df8846
7
- data.tar.gz: fa6bed44f947a7197a490f8407682cf7f47a1a3a0dc695aa17c5cee69549a786479c5b49773c575ebb912cdc933c32eac3541006e40fd59623a6b7d768fc4484
6
+ metadata.gz: 3faff67e89ed9592bf5b7255addbe884154cb21eb4cd9856ef461cd9c9b966b5bc9b5ab15635006f3a0346ab04041aef008d514996452e0f9c42178012840c7a
7
+ data.tar.gz: 1b205ad3dd475ff19d16e1d65b36b89d86bdc5493ede8efc5e9a56abca64fb9416750e6de9cd89e797659ecaf6d3fab4d0e80b8a8fa2d9bd50b73ecd569f622d
@@ -48,7 +48,7 @@ module BooticCli
48
48
  def push
49
49
  within_theme do
50
50
  local_theme, remote_theme = theme_selector.select_theme_pair(default_subdomain, current_dir, options['public'])
51
- warn_user if remote_theme.public? and options['public'].nil?
51
+ warn_about_public if remote_theme.public? and options['public'].nil?
52
52
  workflows.push(local_theme, remote_theme, delete: options['delete'] || true)
53
53
  prompt.say "Done! View updated version at #{remote_theme.path}", :cyan
54
54
  end
@@ -59,7 +59,7 @@ module BooticCli
59
59
  def sync
60
60
  within_theme do
61
61
  local_theme, remote_theme = theme_selector.select_theme_pair(default_subdomain, current_dir, options['public'])
62
- warn_user if remote_theme.public? and options['public'].nil?
62
+ warn_about_public if remote_theme.public? and options['public'].nil?
63
63
  workflows.sync(local_theme, remote_theme)
64
64
  prompt.say "Synced! Preview this theme at #{remote_theme.path}", :cyan
65
65
  end
@@ -78,8 +78,17 @@ module BooticCli
78
78
  option :public, banner: '<true|false>', type: :boolean, aliases: '-p', desc: 'Pushes any changes to public theme, even if dev theme exists'
79
79
  def watch
80
80
  within_theme do
81
- _, remote_theme = theme_selector.select_theme_pair(default_subdomain, current_dir, options['public'])
82
- warn_user if remote_theme.public? and options['public'].nil?
81
+ local_theme, remote_theme = theme_selector.select_theme_pair(default_subdomain, current_dir, options['public'])
82
+ warn_about_public if remote_theme.public? and options['public'].nil?
83
+
84
+ diff = BooticCli::Themes::ThemeDiff.new(source: local_theme, target: remote_theme)
85
+ if diff.any?
86
+ unless prompt.yes_or_no?("There are differences between the remote theme and your local copy. Continue anyway?", true)
87
+ prompt.say "No problem. Bye."
88
+ exit 1
89
+ end
90
+ end
91
+
83
92
  workflows.watch(current_dir, remote_theme)
84
93
  end
85
94
  end
@@ -90,7 +99,7 @@ module BooticCli
90
99
  local_theme, remote_theme = theme_selector.select_theme_pair(default_subdomain, current_dir)
91
100
 
92
101
  if remote_theme.public?
93
- say "You don't seem to have a development theme set up, so there's nothing to publish!", :red
102
+ prompt.say "You don't seem to have a development theme set up, so there's nothing to publish!", :red
94
103
  else
95
104
 
96
105
  # check if there are any differences between the dev and public themes
@@ -104,13 +113,13 @@ module BooticCli
104
113
  end
105
114
  end
106
115
 
107
- # say("Publishing means all your public theme's templates and assets will be replaced and lost.")
116
+ # prompt.say("Publishing means all your public theme's templates and assets will be replaced and lost.")
108
117
  if prompt.yes_or_no?("Would you like to make a local copy of your current public theme before publishing?", diff.any?) # default to true if changes exist
109
118
 
110
119
  backup_path = File.join(local_theme.path, "public-theme-backup-#{Time.now.to_i}")
111
120
  backup_theme = theme_selector.select_local_theme(backup_path, local_theme.subdomain)
112
121
 
113
- say("Gotcha. Backing up your public theme into #{prompt.highlight(backup_theme.path)}")
122
+ prompt.say("Gotcha. Backing up your public theme into #{prompt.highlight(backup_theme.path)}")
114
123
  workflows.pull(backup_theme, public_theme)
115
124
  prompt.say "Done! Existing public theme was saved to #{prompt.highlight(File.basename(backup_theme.path))}", :cyan
116
125
  end
@@ -140,7 +149,7 @@ module BooticCli
140
149
 
141
150
  private
142
151
 
143
- def warn_user
152
+ def warn_about_public
144
153
  unless prompt.yes_or_no?("You're pushing changes directly to your public theme. Are you sure?", true)
145
154
  prompt.say("Ok, sure. You can skip the above warning prompt by passing a `--public` flag.")
146
155
  abort
@@ -1,3 +1,3 @@
1
1
  module BooticCli
2
- VERSION = "0.5.1"
2
+ VERSION = "0.5.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bootic_cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ismael Celis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-30 00:00:00.000000000 Z
11
+ date: 2018-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor