Browse Source

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

Tom Linton 3 năm trước cách đây
mục cha
commit
e22eb4c3d7
1 tập tin đã thay đổi với 5 bổ sung0 xóa
  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);