refactor: finish moving ssh-* scripts to own installers
[webi-installers/.git] / _webi / packages.js
index b6ed22123ba4254db5fe97d92c42ac70161d0516..bdfec061f18c79432790799549e6a9474935571f 100644 (file)
@@ -35,10 +35,15 @@ pkgs.create = function (Pkgs, basepath) {
   };
 
   Pkgs.get = function (node) {
+    return fs.promises.access(path.join(basepath, node)).then(function () {
+      return Pkgs._get(node);
+    });
+  };
+  Pkgs._get = function (node) {
     var yash = path.join(basepath, node, 'package.yash');
     var curlbash = path.join(basepath, node, 'install.sh');
     var readme = path.join(basepath, node, 'README.md');
-    var winstall = path.join(basepath, node, 'install.bat');
+    var winstall = path.join(basepath, node, 'install.ps1');
     return Promise.all([
       fs.promises
         .readFile(readme, 'utf-8')
@@ -80,7 +85,7 @@ pkgs.create = function (Pkgs, basepath) {
         // no winstaller
         winstall = '';
         if ('ENOENT' !== e.code && 'ENOTDIR' !== e.code) {
-          console.error("failed to read '" + node + "/install.bat'");
+          console.error("failed to read '" + node + "/install.ps1'");
           console.error(e);
         }
       })