From 94d3d4f85a245f474091a5e241e249ecbc2c12a1 Mon Sep 17 00:00:00 2001 From: Alexey Pavlov Date: Thu, 12 Apr 2018 10:20:30 +0200 Subject: [PATCH 12/23] Use shell wrapper script for npm on MSYS2 mingw-w64 --- tools/install.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tools/install.py b/tools/install.py index 8f816dc1..0d65d61a 100755 --- a/tools/install.py +++ b/tools/install.py @@ -103,7 +103,10 @@ def package_files(options, action, name, bins): if action == uninstall: action(options, [link_path], os.path.join('bin', bin_name)) elif action == install: - try_symlink(options, os.path.join('../lib/node_modules', name, bin_target), link_path) + if sys.platform == 'win32': + try_copy(options, os.path.join('deps/npm/bin', bin_name), link_path) + else: + try_symlink(options, os.path.join('../lib/node_modules', name, bin_target), link_path) else: assert 0 # unhandled action type @@ -133,6 +136,14 @@ def corepack_files(options, action): try_symlink(options, '../lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js', link_path) else: assert 0 # unhandled action type + elif sys.platform == 'win32': + link_path = abspath(options.install_path, 'bin/node-gyp') + if action == uninstall: + action(options, [link_path], 'bin/node-gyp') + elif action == install: + try_copy(options, 'deps/npm/bin/node-gyp-bin/node-gyp', link_path) + else: + assert 0 # unhandled action type def subdir_files(options, path, dest, action): source_path, _ = mkpaths(options, path, dest) -- 2.17.0.windows.1