fix: make CLI bin invoke program parse
This commit is contained in:
6
bin/warelay.js
Normal file
6
bin/warelay.js
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
import("../dist/index.js").then((mod) => {
|
||||||
|
if (mod?.program?.parseAsync) {
|
||||||
|
mod.program.parseAsync(process.argv);
|
||||||
|
}
|
||||||
|
});
|
||||||
@@ -5,9 +5,9 @@
|
|||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"bin": {
|
"bin": {
|
||||||
"warelay": "dist/index.js",
|
"warelay": "bin/warelay.js",
|
||||||
"warely": "dist/index.js",
|
"warely": "bin/warelay.js",
|
||||||
"wa": "dist/index.js"
|
"wa": "bin/warelay.js"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "tsx src/index.ts",
|
"dev": "tsx src/index.ts",
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ export function buildProgram() {
|
|||||||
program
|
program
|
||||||
.name("warelay")
|
.name("warelay")
|
||||||
.description("WhatsApp relay CLI (Twilio or WhatsApp Web session)")
|
.description("WhatsApp relay CLI (Twilio or WhatsApp Web session)")
|
||||||
.version("1.0.0");
|
.version("0.1.0");
|
||||||
|
|
||||||
program
|
program
|
||||||
.command("login")
|
.command("login")
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ export async function createWaSocket(printQr: boolean, verbose: boolean) {
|
|||||||
version,
|
version,
|
||||||
logger,
|
logger,
|
||||||
printQRInTerminal: false,
|
printQRInTerminal: false,
|
||||||
browser: ["Warelay", "CLI", "1.0.0"],
|
browser: ["Warelay", "CLI", "0.1.0"],
|
||||||
syncFullHistory: false,
|
syncFullHistory: false,
|
||||||
markOnlineOnConnect: false,
|
markOnlineOnConnect: false,
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user