-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: make it possible for windows to checkout (#1270)
Fixes #1255
- Loading branch information
Showing
7 changed files
with
114 additions
and
105 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,82 @@ | ||
const fs = require('fs'); | ||
const assert = require('assert'); | ||
const utils = require('../utils'); | ||
const appJS = utils.appjs; | ||
const run = utils.run; | ||
|
||
const filenames = [ | ||
[__dirname + 'some\\\"file', '#!/usr/bin/env node\nconsole.log("OK");'], | ||
[__dirname + 'some\ \\file', '#!/bin/sh\necho "OK"'], | ||
]; | ||
|
||
if (!process.env.TRAVIS && process.platform !== 'win32') { | ||
describe('nodemon fork (mac only)', () => { | ||
before(() => { | ||
filenames.map(file => fs.writeFileSync(file[0], file[1], 'utf8')); | ||
}); | ||
|
||
after(() => { | ||
filenames.map(file => fs.unlinkSync(file[0])); | ||
}); | ||
|
||
it('should start a fork exec with quotes and escaping', done => { | ||
var found = false; | ||
var p = run({ | ||
exec: 'bin/nodemon.js', | ||
// make nodemon verbose so we can check the filters being applied | ||
args: ['-q', '--exec', filenames[0][0]] | ||
}, { | ||
error: function (data) { | ||
p.send('quit'); | ||
done(new Error(data)); | ||
}, | ||
output: function (data) { | ||
// process.stdout.write(data); | ||
if (data.trim() === 'OK') { | ||
found = true; | ||
} | ||
} | ||
}); | ||
|
||
p.on('message', function (event) { | ||
if (event.type === 'start') { | ||
setTimeout(function () { | ||
p.send('quit'); | ||
done(); | ||
assert(found, '"OK" message was found'); | ||
}, 500); | ||
} | ||
}); | ||
}); | ||
|
||
it('should start a fork exec with spaces and slashes', done => { | ||
var found = false; | ||
var p = run({ | ||
exec: 'bin/nodemon.js', | ||
// make nodemon verbose so we can check the filters being applied | ||
args: ['-q', '--exec', `"${filenames[1][0]}`] | ||
}, { | ||
error: function (data) { | ||
p.send('quit'); | ||
done(new Error(data)); | ||
}, | ||
output: function (data) { | ||
// process.stdout.write(data); | ||
if (data.trim() === 'OK') { | ||
found = true; | ||
} | ||
} | ||
}); | ||
|
||
p.on('message', function (event) { | ||
if (event.type === 'start') { | ||
setTimeout(function () { | ||
p.send('quit'); | ||
done(); | ||
assert(found, '"OK" message was found'); | ||
}, 500); | ||
} | ||
}); | ||
}); | ||
}); | ||
} |
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