From 89ed95e2ae15ea39726653f74a2ba28bd2772968 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 16 Dec 2014 09:08:26 -0800 Subject: [PATCH] Add apm sh shim --- resources/win/apm.sh | 3 +++ src/browser/squirrel-update.coffee | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 resources/win/apm.sh diff --git a/resources/win/apm.sh b/resources/win/apm.sh new file mode 100644 index 000000000..9537f8a32 --- /dev/null +++ b/resources/win/apm.sh @@ -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" "$@" diff --git a/src/browser/squirrel-update.coffee b/src/browser/squirrel-update.coffee index 2bd15ae2c..f41975147 100644 --- a/src/browser/squirrel-update.coffee +++ b/src/browser/squirrel-update.coffee @@ -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)