fanforce-cli 1.4.0 → 1.5.0

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
  SHA1:
3
- metadata.gz: 1af9fd6b56083e9e775589b417c5c092ed018d93
4
- data.tar.gz: b4516deba5718e215fd06681e701e64d0f05aaa1
3
+ metadata.gz: aeab880f5168b856b1998e11ba3f810f18a50809
4
+ data.tar.gz: 2c6f824c162d6e5931f1716352dc3a539a623b33
5
5
  SHA512:
6
- metadata.gz: 1642719befa6e9b9cbc378c7df65cc46a9f429658a827ae50f1412e5c9607865fa866993e701cb53ba9d5b639b8f18111316c1234a04557e2f51058e7bba5b39
7
- data.tar.gz: b4c21899e4b0bda43770a141151f5cd6f7e3c08b8ca41c67e77b4ff9830596b71573ff1ccd7c38a25a90d4c94f8a64c6647a583a856a92b31970f109d089b077
6
+ metadata.gz: 3aaa7385d5bcc8eff652db65081fd6fba4cd552b7818719dcd42dbe9792202328b15bab988ebec5b4f77929052608c4922c1a3a82fa3e0a672a9a3b321bbdff8
7
+ data.tar.gz: ae72bf0f2b16c09d5919109b5ef5506ea95e3283d221e873a61b22f9097bba75a608a0170f35e94750131f09a332372f68119b181c3f05bc8ef8612cc80920fd
@@ -63,8 +63,25 @@ class Fanforce::CLI
63
63
  #################################################################
64
64
 
65
65
  elsif ARGV[0] == 'update'
66
- ARGV[1] =~ /^(all|app-([a-z0-9-]+))$/ || error('You supplied an invalid update command.', :update) if ARGV[1]
67
- ($2 && $2 != 'all') ? update_app($2) : run(:update)
66
+ if (!ARGV[1] or ARGV[1] == 'all') and !ARGV[2] and !$Filter
67
+ app_id = 'all'
68
+ elsif ARGV[1] =~ /^(all|app-([a-z0-9-]+))$/
69
+ app_id = ($1 == 'all') ? $1 : $2
70
+ raw_command = ARGV[2]
71
+ elsif ARGV[1]
72
+ raw_command = ARGV[1]
73
+ else
74
+ error('You supplied an invalid update command.', :update)
75
+ end
76
+
77
+ if raw_command
78
+ error('You supplied an invalid update command.', :update) if raw_command !~ /^(all|files|bundle|pow|get|env)$/
79
+ command = $1.to_sym
80
+ else
81
+ command = :all
82
+ end
83
+
84
+ (!app_id or app_id == 'all') ? run(:update, command) : update_app(app_id, command)
68
85
 
69
86
  #################################################################
70
87
 
@@ -63,7 +63,7 @@ class Fanforce::CLI
63
63
  puts "---------------------------------------------------------------------------------------------------------------\n"
64
64
  end
65
65
 
66
- def update_app(app_id)
66
+ def update_app(app_id, command)
67
67
  app_dir_name = "app-#{app_id}"
68
68
  app_dir = "#{$HomeDir}/#{app_dir_name}"
69
69
 
@@ -74,7 +74,7 @@ class Fanforce::CLI
74
74
  return
75
75
  end
76
76
 
77
- run_update(app_dir, 1, 1)
77
+ run_update(app_dir, 1, 1, command)
78
78
 
79
79
  puts "\n---------------------------------------------------------------------------------------------------------------"
80
80
  puts 'DONE!'.format(:bold,:green)
@@ -145,26 +145,36 @@ class Fanforce::CLI
145
145
 
146
146
  ######################################################################################################################
147
147
 
148
- def run_update(app_dir, processed_count, total_count)
148
+ def run_update(app_dir, processed_count, total_count, command)
149
149
  app = App.load(app_dir)
150
150
  puts "\n---------------------------------------------------------------------------------------------------------------"
151
151
  puts "#{'app'.upcase.format(:bold)} - #{app._id.upcase.gsub('-',' ').format(:bold)} (#{processed_count} of #{total_count})... "
152
152
 
153
153
  Dir.chdir(app_dir) do
154
- puts "\nUPDATING FILES..."
155
- setup_files(app)
154
+ if [:all,:files].include?(command)
155
+ puts "\nUPDATING FILES..."
156
+ setup_files(app)
157
+ end
156
158
 
157
- puts "\nRUNNING BUNDLER..."
158
- Run.bundle_install(app.dir)
159
+ if [:all,:bundle].include?(command)
160
+ puts "\nRUNNING BUNDLER..."
161
+ Run.bundle_install(app.dir)
162
+ end
159
163
 
160
- puts "\nUPDATING POW DOMAINS..."
161
- setup_pow(app)
164
+ if [:all,:pow].include?(command)
165
+ puts "\nUPDATING POW DOMAINS..."
166
+ setup_pow(app)
167
+ end
162
168
 
163
- puts "\nUPDATING LOCAL GIT REPOSITORY..."
164
- setup_local_git(app)
169
+ if [:all,:git].include?(command)
170
+ puts "\nUPDATING LOCAL GIT REPOSITORY..."
171
+ setup_local_git(app)
172
+ end
165
173
 
166
- puts "\nUPDATING ENV VARIABLES..."
167
- setup_envs(app, :development)
174
+ if [:all,:env].include?(command)
175
+ puts "\nUPDATING ENV VARIABLES..."
176
+ setup_envs(app, :development)
177
+ end
168
178
 
169
179
  print "\nRESTARTING POW... "
170
180
  restart(app, :development)
@@ -31,7 +31,12 @@ create app-ID Creates a new app folder and
31
31
  end
32
32
 
33
33
  def update_command; <<-eos
34
- update *all|app-ID Similar to the create command, except it updates existing files
34
+ update *all|app-ID [*all|OR...] Similar to the create command, except it updates existing files
35
+ |files Ensure all needed files exists and contain correct config
36
+ |bundle Run bundle install
37
+ |pow Ensure correct pow domains are configured
38
+ |git Ensure git is initialized
39
+ |env Update ENV variables
35
40
  eos
36
41
  end
37
42
 
@@ -1,5 +1,5 @@
1
1
  class Fanforce
2
2
  class CLI
3
- VERSION = '1.4.0'
3
+ VERSION = '1.5.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fanforce-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Caleb Clark