vagrant-vmm 1.0.11 → 1.0.12

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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZjhmNmQ4N2YwMmFjNmQyYjdlOWRlZTQ1MzFlMmRmZDY4MTAxYzViNw==
4
+ YTgxMzE5YjIyYjQ0NzE1YTQ2N2JmYjVhOTI3NGFkODc2ZTllOTM4OQ==
5
5
  data.tar.gz: !binary |-
6
- YWJjNTZmZDZmZjI3YTA1MGMxNmJmYjRkZWQ3NDcwYTQ4YjllMGM1OA==
6
+ ODI3YzYxODYwYjc1Y2Y2YjhiYjgzNzU2NjUyM2U3YWQ1ZjRkMjc3ZQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YWJiYjBlYjhkN2RlZTllMzM3YTNjMzAzMDIzOWZhMDk4NDFjNWE4ZGRhOWU5
10
- YzcyODBhYTMyMjY3ZjA1MGU2YmExYjQ3MGZjNzk4NjQ4MjBmZGZiNDNlYzA4
11
- NmRhZGMwMDE2MWMyNzc5MzY0MDk0ZWYwMzQzMGEyZmI3NDcwODU=
9
+ MWE5ODliYTMzYzQ2ZGVhODE3OGMxYjQ1MDM0NDRjMWY0OWMyNDU1YTYyNDdj
10
+ M2NjMWIwOWViZjJhM2Y2NTBmOWQyN2Y0N2U5NDY5MTRiZWFhZmFkMDZjYzgx
11
+ ZmYyZTE2ZWNiZmE4NmI2NzU5ZjA1Mzk0Y2ViZDQzMzI4NjQ2MGQ=
12
12
  data.tar.gz: !binary |-
13
- NzY4YzZhMDA2NmFjMTAyYzcxOTQ5N2UxODczMmU5MWEyNGU5MzVjN2E3M2Q4
14
- OTEzYTkxYTYxZmMxZDhlYmM5ZWVkMmRmMWIwYTVjZDM3ODRlODlmNGYwZWUy
15
- NGMyMGE5ZmFlMjExNTAxYzdmNjUxNWVhYmYzMGI2NmNmNDdhYzc=
13
+ Y2VmODkzODNjYjA2Y2Y3NGRjN2M0NmM1NzRiYWU0NjA5YzUxYzA0OTAwNDc5
14
+ OWMxMmMyNjc1MWIyYmIyMzk5ZjNlNmQ2MTlkY2IzNzNlMTYzZTQ5NzI5YzNl
15
+ MjRjYzI0NWY0OTY5OTY2ODFiZTgwNDIzM2U4MGUwNjJkOWVkMzQ=
@@ -57,7 +57,7 @@ function Get-file-hash($source_paths, $delimiter) {
57
57
  # get empty dirs, set hash to be 0 for them
58
58
  Get-ChildItem $source_path_normalized -recurse |
59
59
  Where-Object {$_.PSIsContainer -eq $True} |
60
- Where-Object {$_.GetFiles().Count -eq 0} |
60
+ Where-Object {$_.GetFiles().Count -eq 0 -and $_.GetDirectories().Count -eq 0} |
61
61
  Select-Object FullName | ForEach-Object -Process {
62
62
  $source_files[$source_path] += $_.FullName.Replace($source_path_normalized, "") + $delimiter + "0"
63
63
  }
@@ -112,22 +112,38 @@ function Send-File
112
112
  $position = 0
113
113
 
114
114
  ## Go through the input, and fill in the new array of file content
115
- foreach ($chunk in $input)
116
- {
117
- [GC]::Collect()
118
- [Array]::Copy($chunk, 0, $destBytes, $position, $chunk.Length)
119
- $position += $chunk.Length
120
- }
121
-
122
- [IO.File]::WriteAllBytes($fileDest, $destBytes)
115
+ if ( $input )
116
+ {
117
+ foreach ($chunk in $input)
118
+ {
119
+ [GC]::Collect()
120
+ [Array]::Copy($chunk, 0, $destBytes, $position, $chunk.Length)
121
+ $position += $chunk.Length
122
+ }
123
+ }
124
+
125
+ if ( $position -eq 0 )
126
+ {
127
+ # create empty file
128
+ New-Item $fileDest -type file
129
+ } else
130
+ {
131
+ [IO.File]::WriteAllBytes($fileDest, $destBytes)
132
+ }
123
133
 
124
134
  #Get-Item $fileDest
125
135
  [GC]::Collect()
126
- }
136
+ }
127
137
 
128
138
  # Stream the chunks into the remote script.
129
139
  $Length = $sourceBytes.Length
130
- $streamChunks | Invoke-Command -Session $Session -ScriptBlock $remoteScript
140
+ if ( $Length -eq 0 )
141
+ {
142
+ $res = Invoke-Command -Session $Session -ScriptBlock $remoteScript
143
+ } else
144
+ {
145
+ $streamChunks | Invoke-Command -Session $Session -ScriptBlock $remoteScript
146
+ }
131
147
  Write-Verbose -Message "WinRM copy of [$($p)] to [$($Destination)] complete"
132
148
  }
133
149
  }
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module VMM
3
- VERSION = "1.0.11"
3
+ VERSION = "1.0.12"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-vmm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.11
4
+ version: 1.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - jarig