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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 23186fbbded3a0c29e739e997a4f1164bc271d2e
4
- data.tar.gz: 672c6aae2e11c5b5c41d038c63d1bff5896f3271
3
+ metadata.gz: b5757e7c50091e6ddce4d8f8aeab13244d9bc00d
4
+ data.tar.gz: c25fe085a31627cb7f3991ef30b67982f3050707
5
5
  SHA512:
6
- metadata.gz: 03ceb14621642a3e9b7182f32c327ec9b84d2116a039ab9b79826668ad2e0c32646efecf2701b10e5de7e184555f1379572a7702159cffd08697de852c5b1f07
7
- data.tar.gz: 751dd36b50072ee24e6d3a386a3ff0fa7393733c5a74cc5ea56d12cda968b10392458a5fc383d6faff4edefb10c02e79b246c76adaa21aa3ab51ac3f828e5b9f
6
+ metadata.gz: fc84389fe7aa1dc15fac45b106978190b06ed461a178343dc85fc6b2835bf7d8840731dbc9521378c7c461462c7da31eed5b1ed9320c2e2889e61503228ce45a
7
+ data.tar.gz: 984a5d5498c0045f1bfd409631c2f098e795b802cc28b8c58237269f0ee19d3648d6022802e3fbf4cafb0f725d7f9ed512a894a53e65030d2adc43bc4a0dc784
@@ -1,5 +1,5 @@
1
1
  module Arethusa
2
2
  class CLI
3
- VERSION = "0.1.8"
3
+ VERSION = "0.1.9"
4
4
  end
5
5
  end
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
- @sudo = options[:sudo] ? '-t sudo ' : ''
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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arethusa-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - LFDM