Add apm sh shim

This commit is contained in:
Kevin Sawicki
2014-12-16 09:08:26 -08:00
parent ed1fbcc8e7
commit 89ed95e2ae
2 changed files with 9 additions and 1 deletions

3
resources/win/apm.sh Normal file
View File

@@ -0,0 +1,3 @@
#!/bin/sh
"$0/../app/apm/node_modules/atom-package-manager/bin/node.exe" "$0/../app/apm/node_modules/atom-package-manager/lib/cli.js" "$@"

View File

@@ -123,10 +123,15 @@ addCommandsToPath = (callback) ->
relativeApmPath = path.relative(binFolder, path.join(process.resourcesPath, 'app', 'apm', 'node_modules', 'atom-package-manager', 'bin', 'apm.cmd'))
apmCommand = "@echo off\r\n\"%~dp0\\#{relativeApmPath}\" %*"
apmShCommandPath = path.join(binFolder, 'apm')
relativeApmShPath = path.relative(binFolder, path.join(appFolder, 'resources', 'cli', 'apm.sh'))
apmShCommand = "#!/bin/sh\r\n\"$0/#{relativeApmShPath.replace(/\\/g, '/')}\" \"$@\""
fs.writeFile atomCommandPath, atomCommand, ->
fs.writeFile atomShCommandPath, atomShCommand, ->
fs.writeFile apmCommandPath, apmCommand, ->
callback()
fs.writeFile apmShCommandPath, apmShCommand, ->
callback()
addBinToPath = (pathSegments, callback) ->
pathSegments.push(binFolder)