packer-community / winrmcp

Copy files to a remote host using WinRM
MIT License
59 stars 31 forks source link

Absolute source paths are prepended into the target path #1

Closed mefellows closed 9 years ago

mefellows commented 9 years ago

Currently if you supply an absolute source path to a folder, a substring of its path is prepended to the target path:

e.g.

bin/winrmcp -user=vagrant -pass=vagrant /Users/mfellows/development/dius/hackathong3-packer/DSC/ c:/DSC

...results in the following file path:

c:/DSC/mfellows/development/dius/hackathong3-packer/DSC/<contents of source folder>

I would expect only the contents of the source path (in this case DSC) to be created on the guest machine.

I discovered this from a Packer test run with the below configuration:

provisioners: [
 {
  "type": "file",
  "source": "/Users/mfellows/development/dius/hackathong3-packer/DSC",
  "destination": "C:/Windows/Temp/DSC"
}
...
mefellows commented 9 years ago

I recall having a similar issue when working on the http uploader for Packer, see https://github.com/packer-community/packer-windows-plugins/commit/ce32828deff3d81db4f176c31a9b289a7c84d279 for the bug fix.

mefellows commented 9 years ago

Fixed, build passing (and also Tested in a Packer run).

dylanmei commented 9 years ago

Awesome thanks!