summaryrefslogtreecommitdiff
path: root/src/tools/refresh-question.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/refresh-question.ts')
-rw-r--r--src/tools/refresh-question.ts20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/tools/refresh-question.ts b/src/tools/refresh-question.ts
index 83d71ff303..5104590bf4 100644
--- a/src/tools/refresh-question.ts
+++ b/src/tools/refresh-question.ts
@@ -4,11 +4,15 @@ async function main(uri: string): Promise<any> {
return await updateQuestion(uri);
}
-const args = process.argv.slice(2);
-const uri = args[0];
-
-main(uri).then(result => {
- console.log(`Done: ${result}`);
-}).catch(e => {
- console.warn(e);
-});
+export default () => {
+ const args = process.argv.slice(3);
+ const uri = args[0];
+
+ main(uri).then(result => {
+ console.log(`Done: ${result}`);
+ process.exit(0);
+ }).catch(e => {
+ console.warn(e);
+ process.exit(1);
+ });
+}