From 9cf4b9e4ad44f35ca4230f4173993d2598cb6f8d Mon Sep 17 00:00:00 2001 From: x-ray Date: Thu, 16 May 2024 10:50:22 +0800 Subject: [PATCH] fix: raw mode warn --- package.json | 2 +- source/cli.tsx | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index fc5c00f..6145d34 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "2fa-cmd", - "version": "0.0.5", + "version": "0.0.6", "description": "A command tool for Google Authenticator", "author": "x-ray-s", "email": "princesswar721@gmail.com", diff --git a/source/cli.tsx b/source/cli.tsx index 41bb3b7..4b25853 100644 --- a/source/cli.tsx +++ b/source/cli.tsx @@ -55,6 +55,9 @@ const cli = meow( const setError = (msg: string) => { console.log(chalk.red(msg)); }; + +let clear = () => {}; + (async function () { const {name, secret, url, token} = cli.flags; @@ -148,10 +151,12 @@ const setError = (msg: string) => { console.log(generate(item.secret).token); return process.exit(0); } -})(); -const {clear} = render(, { - exitOnCtrlC: false, -}); + const {clear: _clear} = render(, { + exitOnCtrlC: false, + }); + + clear = _clear; +})(); export {clear};