-
-
Notifications
You must be signed in to change notification settings - Fork 5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Jinzhe Zeng <[email protected]>
- Loading branch information
Showing
1 changed file
with
29 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,48 @@ | ||
From da61816c3a41ffbf8381c04b6df5e4aada262e01 Mon Sep 17 00:00:00 2001 | ||
From 3c744fcf21d755f393a533df49afdb0c52ce9be3 Mon Sep 17 00:00:00 2001 | ||
From: Jinzhe Zeng <[email protected]> | ||
Date: Thu, 28 Nov 2024 18:44:21 -0500 | ||
Subject: [PATCH] hack ROOT_DIR | ||
|
||
--- | ||
nodejs_wheel/executable.py | 2 +- | ||
1 file changed, 1 insertion(+), 1 deletion(-) | ||
nodejs_wheel/executable.py | 11 ++++++++--- | ||
1 file changed, 8 insertions(+), 3 deletions(-) | ||
|
||
diff --git a/nodejs_wheel/executable.py b/nodejs_wheel/executable.py | ||
index 42f216e..dede038 100644 | ||
index 42f216e..e435399 100644 | ||
--- a/nodejs_wheel/executable.py | ||
+++ b/nodejs_wheel/executable.py | ||
@@ -10,7 +10,7 @@ try: | ||
@@ -10,7 +10,12 @@ try: | ||
except ImportError: | ||
from typing_extensions import Literal # type: ignore | ||
|
||
-ROOT_DIR = os.path.dirname(__file__) | ||
+ROOT_DIR = os.path.join(os.path.dirname(__file__), "..", "..", "..", "..") | ||
+if os.name == "nt": | ||
+ ROOT_DIR = os.path.join(os.path.dirname(__file__), "..", "..", "..") | ||
+ NODE_MODULES_DIR = os.path.join(ROOT_DIR, "node_modules") | ||
+else: | ||
+ ROOT_DIR = os.path.join(os.path.dirname(__file__), "..", "..", "..", "..") | ||
+ NODE_MODULES_DIR = os.path.join(ROOT_DIR, "lib", "node_modules") | ||
|
||
|
||
@overload | ||
@@ -179,7 +184,7 @@ def npm( | ||
if args is None: | ||
args = sys.argv[1:] | ||
return call_node( | ||
- os.path.join(ROOT_DIR, "lib", "node_modules", "npm", "bin", "npm-cli.js"), | ||
+ os.path.join(NODE_MODULES_DIR, "npm", "bin", "npm-cli.js"), | ||
*args, | ||
return_completed_process=return_completed_process, | ||
**kwargs, | ||
@@ -233,7 +238,7 @@ def npx( | ||
if args is None: | ||
args = sys.argv[1:] | ||
return call_node( | ||
- os.path.join(ROOT_DIR, "lib", "node_modules", "npm", "bin", "npx-cli.js"), | ||
+ os.path.join(NODE_MODULES_DIR, "npm", "bin", "npx-cli.js"), | ||
*args, | ||
return_completed_process=return_completed_process, | ||
**kwargs, | ||
-- | ||
2.34.1 | ||
|