aboutsummaryrefslogtreecommitdiff
path: root/src/headless/taler-wallet-cli.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/headless/taler-wallet-cli.ts')
-rw-r--r--src/headless/taler-wallet-cli.ts13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/headless/taler-wallet-cli.ts b/src/headless/taler-wallet-cli.ts
index 435210fcc..0c6c2ba98 100644
--- a/src/headless/taler-wallet-cli.ts
+++ b/src/headless/taler-wallet-cli.ts
@@ -231,7 +231,7 @@ class MerchantBackendConnection {
}
}
-async function main() {
+export async function main() {
const myNotifier = new ConsoleNotifier();
const myBadge = new ConsoleBadge();
@@ -349,7 +349,10 @@ async function main() {
myWallet.stop();
}
-main().catch(err => {
- console.error("Failed with exception:");
- console.error(err);
-});
+
+if (require.main === module) {
+ main().catch(err => {
+ console.error("Failed with exception:");
+ console.error(err);
+ });
+}