vagrant-scp 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -2
- data/lib/vagrant/scp/commands/scp.rb +14 -4
- data/lib/vagrant/scp/version.rb +1 -1
- metadata +13 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 056e0192ea635266592a0eeb2fc8ebc830bad160
|
4
|
+
data.tar.gz: 4ba0bc5fc9f408745ebfdeec75072196e73260f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9d548c352f4bad8b97f9edb56a013b6dba0fa9b8cef8c3634f3d9081aab5f7965791a2172e93af22270cf7df7be22226f05c02d4623b3cc9b8a6db2e66f67795
|
7
|
+
data.tar.gz: 670e2056b2eca67c16a7ac58834571b70505d0b2d5e1c1e791da0af88cd2b9b98aae5b96648c3ee52b5e4bf21968ea24db07cb2fd16012b36ca82e4d5524560a
|
data/README.md
CHANGED
@@ -14,8 +14,12 @@ If you have just a single Vagrant VM, you can copy files over like this:
|
|
14
14
|
|
15
15
|
vagrant scp <some_local_file_or_dir> <somewhere_on_the_vm>
|
16
16
|
|
17
|
-
If you have multiple VMs, you
|
17
|
+
If you have multiple VMs, you can specify it.
|
18
18
|
|
19
|
-
vagrant scp <some_local_file_or_dir> <somewhere_on_the_vm>
|
19
|
+
vagrant scp <some_local_file_or_dir> <vm_name:somewhere_on_the_vm>
|
20
|
+
|
21
|
+
Copying files out of the VM works in the same fashion
|
22
|
+
|
23
|
+
vagrant scp <vm_name:somewhere_on_the_vm> <some_local_file_or_dir>
|
20
24
|
|
21
25
|
That’s it!
|
@@ -10,13 +10,23 @@ module VagrantPlugins
|
|
10
10
|
|
11
11
|
def execute
|
12
12
|
# Parse the arguments
|
13
|
-
|
14
|
-
|
13
|
+
file_1, file_2 = parse_args()
|
14
|
+
# Extract host info
|
15
|
+
#
|
16
|
+
# We want to get the name of the vm, from a [host_1]:file_1 [host_2]:file_2 description
|
17
|
+
host = [file_1, file_2].map{|file_spec| file_spec.match(/^([^:]*):/)[1] rescue nil}.compact.first
|
15
18
|
|
16
19
|
# Get the info about the target VM
|
17
20
|
with_target_vms(host) do |machine|
|
18
21
|
ssh_info = machine.ssh_info
|
19
22
|
raise Vagrant::Errors::SSHNotReady if ssh_info.nil?
|
23
|
+
if file_1.include? ':'
|
24
|
+
source_files = "#{ssh_info[:username]}@#{ssh_info[:host]}:#{file_1.split(':').last}"
|
25
|
+
target_files = file_2
|
26
|
+
else
|
27
|
+
source_files = file_1
|
28
|
+
target_files = "#{ssh_info[:username]}@#{ssh_info[:host]}:#{file_2.split(':').last}"
|
29
|
+
end
|
20
30
|
|
21
31
|
# Run the SCP
|
22
32
|
command = [
|
@@ -27,7 +37,7 @@ module VagrantPlugins
|
|
27
37
|
"-o port=#{ssh_info[:port]}",
|
28
38
|
"-i '#{ssh_info[:private_key_path][0]}'",
|
29
39
|
source_files,
|
30
|
-
|
40
|
+
target_files
|
31
41
|
].join(' ')
|
32
42
|
system(command)
|
33
43
|
end
|
@@ -41,7 +51,7 @@ module VagrantPlugins
|
|
41
51
|
o.separator ""
|
42
52
|
end
|
43
53
|
argv = parse_options(opts)
|
44
|
-
@env.ui.info(opts.help, prefix: false)
|
54
|
+
@env.ui.info(opts.help, prefix: false) unless argv.length == 2
|
45
55
|
return argv
|
46
56
|
end
|
47
57
|
|
data/lib/vagrant/scp/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-scp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luca Invernizzi
|
@@ -14,56 +14,56 @@ dependencies:
|
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.3'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.3'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: log4r
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ~>
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '1.1'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '1.1'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: net-scp
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ~>
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '1.1'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ~>
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '1.1'
|
69
69
|
description: Copy files to a Vagrant VM via SCP.
|
@@ -73,7 +73,7 @@ executables: []
|
|
73
73
|
extensions: []
|
74
74
|
extra_rdoc_files: []
|
75
75
|
files:
|
76
|
-
-
|
76
|
+
- .gitignore
|
77
77
|
- Gemfile
|
78
78
|
- LICENSE.txt
|
79
79
|
- README.md
|
@@ -93,17 +93,17 @@ require_paths:
|
|
93
93
|
- lib
|
94
94
|
required_ruby_version: !ruby/object:Gem::Requirement
|
95
95
|
requirements:
|
96
|
-
- -
|
96
|
+
- - '>='
|
97
97
|
- !ruby/object:Gem::Version
|
98
98
|
version: '0'
|
99
99
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- -
|
101
|
+
- - '>='
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: '0'
|
104
104
|
requirements: []
|
105
105
|
rubyforge_project:
|
106
|
-
rubygems_version: 2.
|
106
|
+
rubygems_version: 2.0.3
|
107
107
|
signing_key:
|
108
108
|
specification_version: 4
|
109
109
|
summary: Copy files to a Vagrant VM via SCP.
|