theme-juice 0.1.4 → 0.1.5
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/theme-juice/scaffold.rb +17 -2
- data/lib/theme-juice/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: 332a3523300015d28a1619870891540924ed4223
|
|
4
|
+
data.tar.gz: 5281f377111d7792b2c2d4eaa117b1bd6d5681da
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 93067dbbeaaae931315a924e5f2599ab535ecaae4e5b1f088f65c553308b6da6e0af9ae3410d2a943d2cacf9bdbc1527c32fd4c5374522df6c0e7b9014822a06
|
|
7
|
+
data.tar.gz: a1b524499915972c4d155c96b4a54f94bf5d08e466f254de21a9c027fe09b4714037c7272d827d70fe54ceb39be7d80b6be1e93a48e535a41f2a9f11512e9692
|
data/lib/theme-juice/scaffold.rb
CHANGED
|
@@ -63,8 +63,12 @@ module ThemeJuice
|
|
|
63
63
|
setup_synced_folder
|
|
64
64
|
end
|
|
65
65
|
|
|
66
|
-
if wpcli_exists?
|
|
66
|
+
if wpcli_exists? && !wpcli_is_setup?
|
|
67
67
|
setup_wpcli
|
|
68
|
+
else
|
|
69
|
+
if yes? "Do you want to setup a new 'wp-cli.yml' file? (y/N) :", :green
|
|
70
|
+
setup_wpcli true
|
|
71
|
+
end
|
|
68
72
|
end
|
|
69
73
|
|
|
70
74
|
if @opts[:repository]
|
|
@@ -270,6 +274,13 @@ module ThemeJuice
|
|
|
270
274
|
File.exists? File.expand_path("#{@opts[:site_location]}/.env.development")
|
|
271
275
|
end
|
|
272
276
|
|
|
277
|
+
###
|
|
278
|
+
# @return {Bool}
|
|
279
|
+
###
|
|
280
|
+
def wpcli_is_setup?
|
|
281
|
+
File.readlines(File.expand_path("#{@opts[:site_location]}/wp-cli.yml")).grep(/(url: #{@opts[:dev_url]})/m).any?
|
|
282
|
+
end
|
|
283
|
+
|
|
273
284
|
###
|
|
274
285
|
# @return {Bool}
|
|
275
286
|
###
|
|
@@ -488,10 +499,14 @@ module ThemeJuice
|
|
|
488
499
|
###
|
|
489
500
|
# Add wp-cli-ssh block to wp-cli.yml
|
|
490
501
|
#
|
|
502
|
+
# @param {Bool} fresh
|
|
503
|
+
# Create a fresh wp-cli.yml file
|
|
504
|
+
#
|
|
491
505
|
# @return {Void}
|
|
492
506
|
###
|
|
493
|
-
def setup_wpcli
|
|
507
|
+
def setup_wpcli(fresh = false)
|
|
494
508
|
File.open "#{@opts[:site_location]}/wp-cli.yml", "a+" do |file|
|
|
509
|
+
file.puts "path: wp" if fresh
|
|
495
510
|
file.puts "require:"
|
|
496
511
|
file.puts "\t- vendor/autoload.php"
|
|
497
512
|
file.puts "ssh:"
|
data/lib/theme-juice/version.rb
CHANGED