From eec1af1f52aa217e12e52c7c9d66f0106e66a200 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 3 Apr 2020 23:35:14 +0900 Subject: Revert --- src/tools/resync-remote-user.ts | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) (limited to 'src/tools/resync-remote-user.ts') diff --git a/src/tools/resync-remote-user.ts b/src/tools/resync-remote-user.ts index c30b645725..c9d1ed588c 100644 --- a/src/tools/resync-remote-user.ts +++ b/src/tools/resync-remote-user.ts @@ -6,26 +6,22 @@ async function main(acct: string): Promise { await resolveUser(username, host, {}, true); } -export default () => { - // get args - const args = process.argv.slice(3); - let acct = args[0]; +// get args +const args = process.argv.slice(2); +let acct = args[0]; - // normalize args - acct = acct.replace(/^@/, ''); +// normalize args +acct = acct.replace(/^@/, ''); - // check args - if (!acct.match(/^\w+@\w/)) { - throw `Invalid acct format. Valid format are user@host`; - } +// check args +if (!acct.match(/^\w+@\w/)) { + throw `Invalid acct format. Valid format are user@host`; +} - console.log(`resync ${acct}`); +console.log(`resync ${acct}`); - main(acct).then(() => { - console.log('Done'); - process.exit(0); - }).catch(e => { - console.warn(e); - process.exit(1); - }); -} +main(acct).then(() => { + console.log('Done'); +}).catch(e => { + console.warn(e); +}); -- cgit v1.2.3-freya