You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/yarnpkg-cli/sources/main.ts
+17-8Lines changed: 17 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,13 @@ import {pluginCommands}
10
10
functionrunBinary(path: PortablePath){
11
11
constphysicalPath=npath.fromPortablePath(path);
12
12
13
+
if(!physicalPath){
14
+
throwObject.assign(
15
+
newError(`runBinary ${path} ENOENT`),
16
+
{code: `ENOENT`,errno: -2},
17
+
);
18
+
}
19
+
13
20
process.on(`SIGINT`,()=>{
14
21
// We don't want SIGINT to kill our process; we want it to kill the
15
22
// innermost process, whose end will cause our own to exit.
@@ -99,14 +106,16 @@ export async function main({binaryVersion, pluginConfiguration}: {binaryVersion:
99
106
awaitexec(cli);
100
107
return;
101
108
}elseif(yarnPath!==null&&!ignorePath){
102
-
if(!xfs.existsSync(yarnPath)){
103
-
process.stdout.write(cli.error(newError(`The "yarn-path" option has been set (in ${configuration.sources.get(`yarnPath`)}), but the specified location doesn't exist (${yarnPath}).`)));
104
-
process.exitCode=1;
105
-
}else{
106
-
try{
107
-
runBinary(yarnPath);
108
-
}catch(error){
109
-
process.exitCode=error.code||1;
109
+
try{
110
+
runBinary(yarnPath);
111
+
}catch(error){
112
+
if(error.code===`ENOENT`)
113
+
process.stdout.write(cli.error(newError(`The "yarn-path" option has been set (in ${configuration.sources.get(`yarnPath`)}), but the specified location doesn't exist (${yarnPath}).`)));
0 commit comments