first commit

This commit is contained in:
Arwid Thornström
2022-01-19 07:28:09 +01:00
commit f55052d5b3
40 changed files with 6193 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
const { build } = require('gluegun');
/**
* Create the cli and kick it off
*/
async function run(argv) {
// create a CLI runtime
const cli = build()
.brand('pwcli')
.src(__dirname)
.plugins('./node_modules', { matching: 'pwcli-*', hidden: true })
.plugin(__dirname + '/../node_modules/@lenne.tech/gluegun-menu/dist', {
commandFilePattern: '*.js',
extensionFilePattern: '*.js'
})
.help({
name: 'help',
alias: 'helpmeplease',
hidden: true,
dashed: true,
run: toolbox => toolbox.print.info('No help for you!')
}) // provides default for help, h, --help, -h
.version() // provides default for version, v, --version, -v
.create();
// enable the following method if you'd like to skip loading one of these core extensions
// this can improve performance if they're not necessary for your project:
// .exclude(['meta', 'strings', 'print', 'filesystem', 'semver', 'system', 'prompt', 'http', 'template', 'patching', 'package-manager'])
// and run it
const toolbox = await cli.run(argv);
// send it back (for testing, mostly)
return toolbox;
}
module.exports = { run }