-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtano.ts
33 lines (29 loc) · 832 Bytes
/
tano.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright 2018-2024 the tano authors. All rights reserved. MIT license.
/**
* This is the initial module to start the Tano CLI.
*
* @module
*/
import { parseTanoArgs } from './src/tano.config.ts';
import { help } from './src/help.ts';
import { VERSION } from './src/version.ts';
import { task } from './src/task.factory.ts';
import type { TTanoArgs } from './src/types.ts';
import { cli } from './src/cli.ts';
if (import.meta.main) {
const args: TTanoArgs = await parseTanoArgs();
switch (args.action) {
case 'help':
help();
break;
case 'version':
console.log(`v${VERSION}`);
break;
case 'upgrade':
await task('upgrade', 'deno install --allow-run -RWE --unstable-kv -g -f -n tano jsr:@dx/tano/tano').run();
break;
default:
await cli(args);
break;
}
}