Преглед на файлове

cli: Improve error if global anchor not found (#996)

Tom Linton преди 3 години
родител
ревизия
e22eb4c3d7
променени са 1 файла, в които са добавени 5 реда и са изтрити 0 реда
  1. 5 0
      cli/npm-package/anchor.js

+ 5 - 0
cli/npm-package/anchor.js

@@ -72,6 +72,11 @@ function trySystemAnchor() {
       return true;
     });
 
+  if (!absolutePath) {
+    console.error(`Could not find globally installed anchor, install with cargo.`);
+    process.exit();
+  }
+
   const absoluteBinaryPath = `${absolutePath}/anchor`;
 
   const [error, binaryVersion] = getBinaryVersion(absoluteBinaryPath);