From fbe289ea45d73171aad5f03859d9d9da070883e3 Mon Sep 17 00:00:00 2001 From: Roy Ivy III Date: Sat, 5 Nov 2022 13:00:20 -0500 Subject: [PATCH] maint/build ~ (package) add color to 'help' output --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 43ff70e..4eb9716 100644 --- a/package.json +++ b/package.json @@ -149,7 +149,7 @@ "_:debug:env": "node -e \"console.log({env: process.env})\"", "_:exists:git-changelog": "node -e \"if (!require('command-exists').sync('git-changelog')){process.exit(1);};\" || ( shx echo \"WARN `git-changelog` missing (try `go get -u github.com/rivy-go/git-changelog/cmd/git-changelog`)\" & exit 1 )", "* _:help # print usage/TARGETs by matching lines containing leading double-quoted text like `# TARGET_NAME # HELP_TEXT`": "", - "_:help": "< package.json node -e \"s = {p:'',e:'npm'}; if (new String(process.env.npm_execpath).match(/yarn.js$/)) { s = {p:'\\n',e:'yarn'}; }; console.log('%susage: \\`%s run TARGET\\` or \\`npx run-s TARGET [TARGET..]\\`\\n\\nTARGETs:\\n', s.p, s.e); re = /^.*?\\x22(?:#\\s*)(\\w[^#\\x22]*)\\s+#+\\s+([^\\x22]+?)(\\s+#+)?\\x22.*$/; require('readline').createInterface({ input: process.stdin, output: process.stdout, terminal: false }).on('line', function(line){ if (match = re.exec(line)) { console.log('%s %s', match[1].padEnd(19), match[2]); } });\"", + "_:help": "< package.json node -e \"s = {p:'',e:'npm'}; if (new String(process.env.npm_execpath).match(/yarn.js$/)) { s = {p:'\\n',e:'yarn'}; }; console.log('%sUsage: \\`\\x1b[2m%s run TARGET\\x1b[m\\` or \\`\\x1b[2mnpx run-s TARGET [TARGET..]\\x1b[m\\`\\n\\nTARGETs:\\n', s.p, s.e); re = /^.*?\\x22(?:#\\s*)(\\w[^#\\x22]*)\\s+#+\\s+([^\\x22]+?)(\\s+#+)?\\x22.*$/; require('readline').createInterface({ input: process.stdin, output: process.stdout, terminal: false }).on('line', function(line){ if (match = re.exec(line)) { console.log('\\x1b[0;32m%s\\x1b[m %s', match[1].padEnd(19), match[2]); } });\"", "_:is-not-ci": "is-ci && exit 1 || exit 0", "_:lint:commits:all:spell": "node -e \"result=require('child_process').spawnSync('git log --color=never | cspell stdin --no-summary --config \".vscode/cspell.json\"',{shell:true,encoding:'utf-8'}); if (result.status != 0) {console.error('[cspell] ERR! Unknown words in commit(s)\\n'+result.stdout+'\\n'+result.stderr); process.exit(1);} else {console.log(result.stdout);};\"", "* _:lint:commits:new:... * note: review from 'origin/last' or tag just prior to version-sorted latest, with fallback to first commit": "",