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 +4 -4
- data/lib/fanforce/cli/_base.rb +19 -2
- data/lib/fanforce/cli/commands.rb +23 -13
- data/lib/fanforce/cli/help.rb +6 -1
- data/lib/fanforce/cli/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aeab880f5168b856b1998e11ba3f810f18a50809
|
4
|
+
data.tar.gz: 2c6f824c162d6e5931f1716352dc3a539a623b33
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3aaa7385d5bcc8eff652db65081fd6fba4cd552b7818719dcd42dbe9792202328b15bab988ebec5b4f77929052608c4922c1a3a82fa3e0a672a9a3b321bbdff8
|
7
|
+
data.tar.gz: ae72bf0f2b16c09d5919109b5ef5506ea95e3283d221e873a61b22f9097bba75a608a0170f35e94750131f09a332372f68119b181c3f05bc8ef8612cc80920fd
|
data/lib/fanforce/cli/_base.rb
CHANGED
@@ -63,8 +63,25 @@ class Fanforce::CLI
|
|
63
63
|
#################################################################
|
64
64
|
|
65
65
|
elsif ARGV[0] == 'update'
|
66
|
-
ARGV[1]
|
67
|
-
|
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
|
-
|
155
|
-
|
154
|
+
if [:all,:files].include?(command)
|
155
|
+
puts "\nUPDATING FILES..."
|
156
|
+
setup_files(app)
|
157
|
+
end
|
156
158
|
|
157
|
-
|
158
|
-
|
159
|
+
if [:all,:bundle].include?(command)
|
160
|
+
puts "\nRUNNING BUNDLER..."
|
161
|
+
Run.bundle_install(app.dir)
|
162
|
+
end
|
159
163
|
|
160
|
-
|
161
|
-
|
164
|
+
if [:all,:pow].include?(command)
|
165
|
+
puts "\nUPDATING POW DOMAINS..."
|
166
|
+
setup_pow(app)
|
167
|
+
end
|
162
168
|
|
163
|
-
|
164
|
-
|
169
|
+
if [:all,:git].include?(command)
|
170
|
+
puts "\nUPDATING LOCAL GIT REPOSITORY..."
|
171
|
+
setup_local_git(app)
|
172
|
+
end
|
165
173
|
|
166
|
-
|
167
|
-
|
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)
|
data/lib/fanforce/cli/help.rb
CHANGED
@@ -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
|
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
|
|
data/lib/fanforce/cli/version.rb
CHANGED