Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit e8b28ce

Browse files
committed
Quote all the paths to handle spaces etc. Fixes #666
1 parent 5e3edc6 commit e8b28ce

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

bin/apm.cmd

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ for /f "tokens=*" %%G in ('where git 2^>nul') do set "apm_git_path=%%~dpG"
66
if not defined apm_git_path (
77
:: Try to find git.exe in GitHub Desktop, oldest first so we end with newest
88
for /f "tokens=*" %%d in ('dir /b /s /a:d /od "%LOCALAPPDATA%\GitHub\PortableGit*" 2^>nul') do (
9-
if exist %%d\cmd\git.exe set apm_git_path=%%d\cmd
9+
if exist "%%d\cmd\git.exe" set "apm_git_path=%%d\cmd"
1010
)
1111
:: Found one, add it to the path
1212
if defined apm_git_path set "Path=!apm_git_path!;!PATH!"
1313
)
1414

15-
set maybe_node_gyp_path=%~dp0\..\node_modules\node-gyp\bin\node-gyp.js
16-
if exist %maybe_node_gyp_path% (
17-
set npm_config_node_gyp=%maybe_node_gyp_path%
15+
set "maybe_node_gyp_path=%~dp0\..\node_modules\node-gyp\bin\node-gyp.js"
16+
if exist "%maybe_node_gyp_path%" (
17+
set "npm_config_node_gyp=%maybe_node_gyp_path%"
1818
)
1919

2020
if exist "%~dp0\node.exe" (

bin/npm.cmd

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
setlocal EnableDelayedExpansion
33

44
set "PATH=%~dp0;%PATH%"
5-
set maybe_node_gyp_path=%~dp0\..\node_modules\node-gyp\bin\node-gyp.js
6-
if exist %maybe_node_gyp_path% (
7-
set npm_config_node_gyp=%maybe_node_gyp_path%
5+
set "maybe_node_gyp_path=%~dp0\..\node_modules\node-gyp\bin\node-gyp.js"
6+
if exist "%maybe_node_gyp_path%" (
7+
set "npm_config_node_gyp=%maybe_node_gyp_path%"
88
)
9-
%~dp0\..\node_modules\.bin\npm.cmd %*
9+
"%~dp0\..\node_modules\.bin\npm.cmd" %*

0 commit comments

Comments
 (0)