Skip to content

Commit 606e2ea

Browse files
committed
fix: service can now be installed without token
1 parent d37162c commit 606e2ea

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/service.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export class NotInstalledError extends Error {
5151
* Install Cloudflared service.
5252
* @param token Tunnel service token.
5353
*/
54-
export function install(token: string): void {
54+
export function install(token?: string): void {
5555
if (process.platform !== "darwin") {
5656
throw new Error(`Not Implemented on platform ${process.platform}`);
5757
}
@@ -60,7 +60,13 @@ export function install(token: string): void {
6060
throw new AlreadyInstalledError();
6161
}
6262

63-
spawnSync(bin, ["service", "install", token]);
63+
const args = ["service", "install"];
64+
65+
if (token) {
66+
args.push(token);
67+
}
68+
69+
spawnSync(bin, args);
6470
}
6571

6672
/**

0 commit comments

Comments
 (0)