'use strict';
+var frontmarker = require('./frontmarker.js');
var shmatter = require('shmatter');
var fs = require('fs');
var path = require('path');
};
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')
.then(function (txt) {
// TODO
- //return frontmarker.parse(txt);
+ return frontmarker.parse(txt);
})
.catch(function (e) {
if ('ENOENT' !== e.code && 'ENOTDIR' !== e.code) {
// 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);
}
})
]).then(function (items) {
- var meta = items[1];
+ var meta = items[0] || items[1];
if (!meta) {
// doesn't exist
return;