dust-deploy 0.13.10 → 0.13.11
Sign up to get free protection for your applications and to get access to all the features.
- data/changelog.md +6 -0
- data/lib/dust/server.rb +9 -1
- data/lib/dust/version.rb +1 -1
- metadata +2 -2
data/changelog.md
CHANGED
data/lib/dust/server.rb
CHANGED
@@ -149,9 +149,12 @@ module Dust
|
|
149
149
|
|
150
150
|
msg = messages.add("deploying #{File.basename source}", options)
|
151
151
|
|
152
|
+
# check if destination is a directory
|
153
|
+
is_dir = dir_exists?(destination, :quiet => true)
|
154
|
+
|
152
155
|
# save permissions if the file already exists
|
153
156
|
ret = exec "stat -c %a:%u:%g #{destination}"
|
154
|
-
if ret[:exit_code] == 0
|
157
|
+
if ret[:exit_code] == 0 and not is_dir
|
155
158
|
permissions, user, group = ret[:stdout].chomp.split ':'
|
156
159
|
else
|
157
160
|
# files = 644, dirs = 755
|
@@ -173,6 +176,11 @@ module Dust
|
|
173
176
|
chown @node['user'], tmpfile, :quiet => true
|
174
177
|
@ssh.scp.upload! source, tmpfile
|
175
178
|
chown 'root', tmpfile, :quiet => true
|
179
|
+
|
180
|
+
# if destination is a directory, append real filename
|
181
|
+
destination = "#{destination}/#{File.basename(source)}" if is_dir
|
182
|
+
|
183
|
+
# move the file from the temporary location to where it actually belongs
|
176
184
|
msg.parse_result(exec("mv -f #{tmpfile} #{destination}")[:exit_code])
|
177
185
|
|
178
186
|
else
|
data/lib/dust/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dust-deploy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.13.
|
4
|
+
version: 0.13.11
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-06-
|
12
|
+
date: 2012-06-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: json
|