arethusa-cli 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/arethusa/cli/version.rb +1 -1
- data/lib/arethusa/cli.rb +15 -3
- 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: b5757e7c50091e6ddce4d8f8aeab13244d9bc00d
|
4
|
+
data.tar.gz: c25fe085a31627cb7f3991ef30b67982f3050707
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc84389fe7aa1dc15fac45b106978190b06ed461a178343dc85fc6b2835bf7d8840731dbc9521378c7c461462c7da31eed5b1ed9320c2e2889e61503228ce45a
|
7
|
+
data.tar.gz: 984a5d5498c0045f1bfd409631c2f098e795b802cc28b8c58237269f0ee19d3648d6022802e3fbf4cafb0f725d7f9ed512a894a53e65030d2adc43bc4a0dc784
|
data/lib/arethusa/cli/version.rb
CHANGED
data/lib/arethusa/cli.rb
CHANGED
@@ -62,11 +62,17 @@ EOF
|
|
62
62
|
@directory = options[:commit] ? File.join(directory, short_sha) : directory
|
63
63
|
@ssh_options = options[:options]
|
64
64
|
@archive = options[:file]
|
65
|
-
|
65
|
+
|
66
|
+
if options[:sudo]
|
67
|
+
@sudo = true
|
68
|
+
@user = @address.split('@').first
|
69
|
+
end
|
66
70
|
|
67
71
|
@small = options[:small]
|
68
72
|
|
69
73
|
minify if options[:minify] &! @archive
|
74
|
+
|
75
|
+
create_deploy_directory
|
70
76
|
execute
|
71
77
|
say_status(:deployed, "at #{@address} - #{@directory}")
|
72
78
|
end
|
@@ -162,9 +168,15 @@ EOF
|
|
162
168
|
end
|
163
169
|
|
164
170
|
# For deploy command
|
171
|
+
def create_deploy_directory
|
172
|
+
if @sudo
|
173
|
+
`#{ssh} -t sudo mkdir -p #{@directory} && chown #{@user} directory`
|
174
|
+
else
|
175
|
+
`#{ssh} mkdir -p #{@directory}`
|
176
|
+
end
|
177
|
+
end
|
178
|
+
|
165
179
|
def execute
|
166
|
-
puts "#{ssh} #{@sudo} mkdir -p #{@directory}"
|
167
|
-
`#{ssh} #{@sudo} mkdir -p #{@directory}`
|
168
180
|
`#{archive_to_use} | #{ssh} #{decompress}`
|
169
181
|
end
|
170
182
|
|