add shebang. fixes #4

This commit is contained in:
Mathias Buus 2014-11-22 20:29:44 +01:00
parent cff6b91d46
commit 6af9dfc915

View file

@ -22,6 +22,12 @@ var paths = {
win32: path.join(__dirname, './dist/atom.exe')
}
var shebang = {
darwin: '#!/bin/bash\n',
linux: '#!/bin/bash\n',
win32: ''
}
var argv = {
darwin: '"$@"',
linux: '"$@"',
@ -33,7 +39,7 @@ if (!paths[platform]) throw new Error('Unknown platform: '+platform)
nugget(url, {target:name, dir:__dirname, resume:true, verbose:true}, function(err) {
if (err) return onerror(err)
fs.writeFileSync(path.join(__dirname, 'path.txt'), paths[platform])
fs.writeFileSync(path.join(__dirname, 'run.bat'), '"'+paths[platform]+'" '+argv[platform])
fs.writeFileSync(path.join(__dirname, 'run.bat'), shebang[platform]+'"'+paths[platform]+'" '+argv[platform])
extract(path.join(__dirname, name), {dir:path.join(__dirname, 'dist')}, function(err) {
if (err) return onerror(err)
})