Skip to content

Commit 7d72955

Browse files
committed
Support -local for npm
[Gitee link #I9V5I0]
1 parent 076b4e7 commit 7d72955

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/chsrc.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,15 @@ pl_nodejs_setsrc (char *option)
252252

253253
char *cmd = NULL;
254254

255+
char *where = "";
256+
if (Cli_Option_Locally==true)
257+
{
258+
where = "--location project ";
259+
}
260+
255261
if (npm_exist)
256262
{
257-
cmd = xy_2strjoin ("npm config set registry ", source.url);
263+
cmd = xy_strjoin (4, "npm config ", where, "set registry ", source.url);
258264
chsrc_run (cmd);
259265
}
260266

0 commit comments

Comments
 (0)