X-Git-Url: https://git.josue.xyz/?a=blobdiff_plain;f=_webi%2Ftest.js;h=59c1e19907adedfb527aecdc83d943499d5ebd95;hb=9e485b15a7cf11cd6ad3cdbd0be28934cc529cb9;hp=e40495e5abb19d1889841d7964846f14dc2e883c;hpb=445e562616b0bc77cc73910aaa19d3c710003e13;p=webi-installers%2F.git diff --git a/_webi/test.js b/_webi/test.js index e40495e..59c1e19 100755 --- a/_webi/test.js +++ b/_webi/test.js @@ -93,25 +93,43 @@ Releases.get(path.join(process.cwd(), pkgdir)).then(function (all) { console.info(rel); console.info(''); - return Releases.renderBash(pkgdir, rel, { - baseurl: 'https://webinstall.dev', - pkg: pkgname, - tag: pkgtag || '', - ver: '', - os: osrel, - arch, - formats: formats - }).then(function (bashTxt) { + return Promise.all([ + Releases.renderBash(pkgdir, rel, { + baseurl: 'https://webinstall.dev', + pkg: pkgname, + tag: pkgtag || '', + ver: '', + os: osrel, + arch, + formats: formats + }).catch(function () {}), + Releases.renderBatch(pkgdir, rel, { + baseurl: 'https://webinstall.dev', + pkg: pkgname, + tag: pkgtag || '', + ver: '', + os: osrel, + arch, + formats: formats + }).catch(function () {}) + ]).then(function (scripts) { + var bashTxt = scripts[0]; + var batTxt = scripts[1]; var bashFile = 'install-' + pkgname + '.sh'; var batFile = 'install-' + pkgname + '.bat'; if (debug) { - bashTxt = bashTxt.replace(/#set -x/g, 'set -x'); + bashTxt = (bashTxt || 'echo ERROR').replace(/#set -x/g, 'set -x'); + batTxt = (batTxt || 'echo ERROR').replace( + /REM REM todo debug/g, + 'REM todo debug' + ); } - fs.writeFileSync(bashFile, bashTxt, 'utf-8'); console.info('Has the necessary files?'); - console.info('\tNEEDS MANUAL TEST: %s', bashFile); - console.info('\t(todo: ' + batFile + ')'); + fs.writeFileSync(bashFile, bashTxt, 'utf-8'); + console.info('\tNEEDS MANUAL TEST: bash %s', bashFile); + fs.writeFileSync(batFile, batTxt, 'utf-8'); + console.info('\tNEEDS MANUAL TEST: cmd.exe %s', batFile); console.info(''); }); });