vagrant-helpers 1.5.0 → 1.5.1
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/vagrant-helpers.rb +19 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 695246df3540865c9a76f5d5492fb8c575641ac21ccfe5c3bf2af9d064bbafc8
|
4
|
+
data.tar.gz: 8daf3a520f9d37768bbd2797f78e66d546dfc1b1f8a66b349bff9f6a46116e83
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0abb798139b9b2ffc32807c144934ae8dc79b5d4a2ed8efd9c7966c15c963c0d376f97202c6fee973dc54711cea8c241c07ebc65b2d5b55bbbe834cbf35d8914
|
7
|
+
data.tar.gz: 9e68b775b172de06b7701a26c84e6aa0c8b98c26b4af7b148ccb0786cc11bf3ee14f264311327d4e0253b066550a51c5575fec21289f5619b7951c41b6ea0e0f
|
data/lib/vagrant-helpers.rb
CHANGED
@@ -4,6 +4,7 @@ require 'dotenv'
|
|
4
4
|
require 'socket'
|
5
5
|
require 'ipaddr'
|
6
6
|
require 'ip'
|
7
|
+
require 'shellwords'
|
7
8
|
|
8
9
|
module VagrantPlugins
|
9
10
|
module Helpers
|
@@ -164,10 +165,27 @@ module VagrantPlugins
|
|
164
165
|
end
|
165
166
|
end
|
166
167
|
|
168
|
+
def self.command_exist?(command)
|
169
|
+
system("which #{command} > /dev/null 2>&1")
|
170
|
+
end
|
171
|
+
|
172
|
+
def self.windows_path?(path)
|
173
|
+
r = /^[a-zA-Z]:\\[\\\S|*\S]?.*$/
|
174
|
+
!path.match(r).nil?
|
175
|
+
end
|
176
|
+
|
177
|
+
def self.wslpath(path)
|
178
|
+
`wslpath #{::Shellwords.escape(path)}`.strip
|
179
|
+
end
|
180
|
+
|
167
181
|
def self.set_vm_extra_storage(config, vm_storage_drives)
|
168
182
|
config.vm.provider :virtualbox do |v|
|
169
183
|
vm_storage_drives.each_with_index do |entry, ndx|
|
170
|
-
|
184
|
+
entry_path = entry['filename']
|
185
|
+
if windows_path?(entry_path) && command_exist?('wslpath')
|
186
|
+
entry_path = wslpath(entry['filename'])
|
187
|
+
end
|
188
|
+
unless ::File.exist?(entry_path)
|
171
189
|
# create hdd
|
172
190
|
v.customize [
|
173
191
|
'createhd',
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-helpers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Pyatkin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-02-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dotenv
|