forked from mattijs/node-rsync
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update rsync.js with Windows support
* Update rsync.js with Windows support Add a new function: escapeDirectorySeparator() which used in escapeFileArg() to set directory separator correctly under Windows. If you use th cygwin's rsync with OpenSSH for Windows (http://www.mls-software.com/opensshd.html) they are using standard linux directory separator and this update can handle directories under Window. To use rsync under Windows, you need to symlink your directories well (with standard Windows mklink command line tool). * Update rsync.js Copied contents of the escapeDirectorySeparator function under escapeFileArg and remove unused function. * Update input.test.js Add "should convert windows path under windows" for source and "should convert widows path for destination" for destination test. * Update input.test.js Set platform to win32 with safe. * Update input.test.js #sourcewin32 and #destinationwin32 * Create inputwin32.test.js Windows input source and destinatiion testing * Update input.test.js Move windows test to inputwin32.test.js * Update inputwin32.test.js update to mocha before and after (not beforeAll anf afterAll) * Update inputwin32.test.js bugfix: rsync needed
- Loading branch information
Showing
3 changed files
with
60 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* global describe,it */ | ||
"use strict"; | ||
|
||
var assertOutputPattern = require('./helpers/output').assertOutputPattern; | ||
var Rsync = require('../rsync'); | ||
|
||
describe('inputwin32', function () { | ||
before(function(){ | ||
this.originalPlatform = process.platform; | ||
Object.defineProperty(process, 'platform', { | ||
value: 'win32' | ||
}); | ||
}); | ||
|
||
//# sources under windows | ||
describe('#sourcewin32', function () { | ||
var rsync; | ||
|
||
it('should convert windows path under windows',function () { | ||
rsync = Rsync.build({ | ||
source: [ 'C:\\home\\username\\develop\\readme.txt' ], | ||
destination: 'themoon' | ||
}); | ||
assertOutputPattern(rsync, / \/home\/username\/develop\/readme\.txt /); | ||
}); | ||
}); | ||
|
||
//# destination under win32 | ||
describe('#destinationwin32', function () { | ||
var rsync; | ||
|
||
it('should convert widows path for destination', function () { | ||
rsync = Rsync.build({ | ||
source: [ 'reame.txt' ], | ||
destination: 'C:\\home\\username\\develop\\' | ||
}); | ||
assertOutputPattern(rsync, /\/home\/username\/develop\//); | ||
}); | ||
|
||
}); | ||
|
||
after(function(){ | ||
Object.defineProperty(process, 'platform', { | ||
value: this.originalPlatform | ||
}); | ||
}); | ||
}); |