@hraza01/skyhook 1.1.0 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/cli.js +29 -8
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -1,14 +1,30 @@
|
|
|
1
|
+
import fs from "fs"
|
|
2
|
+
import path from "path"
|
|
3
|
+
import { fileURLToPath } from "url"
|
|
1
4
|
import chalk from "chalk"
|
|
2
5
|
import { intro } from "@clack/prompts"
|
|
3
6
|
import ora from "ora"
|
|
4
7
|
import terminalLink from "terminal-link"
|
|
5
8
|
import figlet from "figlet"
|
|
6
9
|
|
|
10
|
+
const __filename = fileURLToPath(import.meta.url)
|
|
11
|
+
const __dirname = path.dirname(__filename)
|
|
12
|
+
const packageJson = JSON.parse(
|
|
13
|
+
fs.readFileSync(path.join(__dirname, "../package.json"), "utf-8"),
|
|
14
|
+
)
|
|
15
|
+
const { version } = packageJson
|
|
16
|
+
const authorName = "@hraza01"
|
|
17
|
+
|
|
18
|
+
const gitLink = terminalLink(
|
|
19
|
+
chalk.dim(authorName),
|
|
20
|
+
`https://github.com/${authorName.replace("@", "")}/skyhook`,
|
|
21
|
+
)
|
|
22
|
+
|
|
7
23
|
/**
|
|
8
24
|
* Display version information
|
|
9
25
|
*/
|
|
10
26
|
export function showVersionInfo() {
|
|
11
|
-
console.log(
|
|
27
|
+
console.log(`skyhook v${version}`)
|
|
12
28
|
process.exit(0)
|
|
13
29
|
}
|
|
14
30
|
|
|
@@ -16,11 +32,6 @@ export function showVersionInfo() {
|
|
|
16
32
|
* Display help information
|
|
17
33
|
*/
|
|
18
34
|
export function showHelpInfo() {
|
|
19
|
-
const gitLink = terminalLink(
|
|
20
|
-
chalk.cyan.underline("@hraza01/skyhook"),
|
|
21
|
-
"https://github.com/hraza01/skyhook",
|
|
22
|
-
)
|
|
23
|
-
|
|
24
35
|
console.clear()
|
|
25
36
|
console.log(
|
|
26
37
|
chalk.cyan.bold("\nSkyhook - Cloud Composer DAG Deployment Utility\n"),
|
|
@@ -48,7 +59,7 @@ export function showHelpInfo() {
|
|
|
48
59
|
export function showIntro() {
|
|
49
60
|
console.clear()
|
|
50
61
|
console.log(
|
|
51
|
-
chalk.cyan(
|
|
62
|
+
chalk.bold.cyan(
|
|
52
63
|
figlet.textSync("Skyhook", {
|
|
53
64
|
font: "Slant",
|
|
54
65
|
horizontalLayout: "default",
|
|
@@ -56,8 +67,18 @@ export function showIntro() {
|
|
|
56
67
|
}),
|
|
57
68
|
),
|
|
58
69
|
)
|
|
70
|
+
|
|
71
|
+
const title = " Cloud Composer DAG Deployment Utility "
|
|
72
|
+
const titleLength = title.length + 3
|
|
73
|
+
const versionLength = `v${version}`.length
|
|
74
|
+
const authorLength = `by ${authorName}`.length
|
|
75
|
+
const padding = " ".repeat(
|
|
76
|
+
Math.max(0, titleLength - authorLength - versionLength),
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
console.log(chalk.dim.blackBright(`by ${gitLink}${padding}v${version}`))
|
|
59
80
|
console.log("")
|
|
60
|
-
intro(chalk.bgCyan.black(
|
|
81
|
+
intro(chalk.bgCyan.black(title))
|
|
61
82
|
}
|
|
62
83
|
|
|
63
84
|
/**
|