-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tmpfile writer to solve rsync problem on windows - issue #42 #79
Conversation
Hi Giovanni I'd like to ask you to rename var writeTempFile = require('./utils').writeTempFile
var tmpFile = writeTempFile(files); Besides that:
Please let me know if you're tired of doing this, so I will do the changes followed by a single commit, which I want to avoid, because you did the work. Thanks! |
Hi Patrick,
Expect the changes done and tested by Monday. |
Hi Patrick, |
var isWin = /^win/i.test(os.platform()); | ||
var fullpath = isWin ? tempFilePath('.') : tempFilePath(); | ||
|
||
mkdirp.sync(path.dirname(fullpath)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's not necessary to create folders at either .
or whatever require('os').tmpdir()
returns, as they already exist.
Thanks man, please see my comment above. |
@@ -0,0 +1,20 @@ | |||
var path = require('path') | |||
, tmpdir = require('os').tmpdir() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please move this below line 5, and use tmpdir = os.tmpdir()
Done! |
Thanks man, this is great. One last task, could you squash this into a single commit? Cheers |
One more thing, sorry for being so picky, but having less dependencies is a good thing. require('crypto').randomBytes(16).toString('hex') |
Sure, I will push the changes tomorrow morning. |
Looks good, can you rebase / squash this into a single commit? |
Done! |
Thanks man, will try to land a new version this weekend! |
tmpfile writer to solve rsync problem on windows - issue #42
Release notes: https://github.com/pstadler/flightplan/releases/tag/0.6.2 |
Hi pstadler,
I forked your project to address the rsync problem on windows reported on #42.
To achieve the cross-platform compatibility, I had to change the path of the file used by rsync listing all the files to transfer, since rsync does not work with path containing the drive letter followed by colon.
On unix-like systems the behavior is completely unaltered. On the other hand, on windows, the cwd is used to contain the temporary file.
I wrote the new
temp-file-write
module, which is similar totemp-write
, but allows you to specify the destination directory (the os temp dir is used by default). I used it in place of the original one in theshell.js
file, together with theos
module to recognize the platform.The system works fine, but I would like to highlight two potential problems:
That being said, I would like to state that in my work I have tested the system and I haven't encountered such problems, using both
deltacopy
andcwRsync
. There are three major requirements on windows, though:git
has to be in the path, as well aspython
2, and fibers have to be supported. An installation of Visual Studio 2013 provides all the required dlls to support them.