From 69955edab492b830cdd84f802a48a3089031666c Mon Sep 17 00:00:00 2001 From: lxghtless Date: Sat, 4 Apr 2020 23:20:59 -0500 Subject: [PATCH] first --- @types/cfonts/index.d.ts | 3 +++ cli.ts | 6 +++--- tsconfig.build.json | 3 ++- tsconfig.json | 3 ++- 4 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 @types/cfonts/index.d.ts diff --git a/@types/cfonts/index.d.ts b/@types/cfonts/index.d.ts new file mode 100644 index 0000000..bc027b7 --- /dev/null +++ b/@types/cfonts/index.d.ts @@ -0,0 +1,3 @@ +declare module 'cfonts' { + export function say(str: string, options: any): void +} diff --git a/cli.ts b/cli.ts index 8922a99..2a1fb9b 100755 --- a/cli.ts +++ b/cli.ts @@ -1,11 +1,11 @@ #!/usr/bin/env node 'use strict' +import {isPiped, run} from './src' import cfonts from 'cfonts' import {argv} from 'yargs' -import {run, isPiped} from './src' -const showHelp = () => { +const showHelp = (): void => { console.log(' ') cfonts.say('clipfs', { font: 'chrome', @@ -34,7 +34,7 @@ const showHelp = () => { console.log(`\n\x1b[2m${helpMenuItems.join('\n\n')}\n\x1b[0m`) } -if (argv.help || argv.h) { +if (process.argv[2] === '--help' || argv.h) { showHelp() } else { const show = (argv.show ?? argv.s) as boolean diff --git a/tsconfig.build.json b/tsconfig.build.json index 2e553b4..5ef804c 100644 --- a/tsconfig.build.json +++ b/tsconfig.build.json @@ -22,7 +22,8 @@ "skipLibCheck": true, "sourceMap": true, "strict": true, - "target": "ES2018" + "target": "ES2018", + "typeRoots": ["./node_modules/@types", "./@types"] }, "exclude": [ "node_modules" diff --git a/tsconfig.json b/tsconfig.json index 72b6ce8..2015d58 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -19,7 +19,8 @@ "resolveJsonModule": true, "skipLibCheck": true, "strict": true, - "target": "ES2018" + "target": "ES2018", + "typeRoots": ["./node_modules/@types", "./@types"] }, "exclude": [ "node_modules"