kubepile 0.0.1 → 0.0.2
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/dist/package.json +2 -2
- package/dist/src/cli.d.ts +1 -1
- package/dist/src/cli.js +10 -16
- package/package.json +2 -2
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kubepile",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "Compile and split kubeconfig files from ~/.config/kubepile.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/src/kubepile.js",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
],
|
|
23
23
|
"scripts": {
|
|
24
24
|
"clean": "rm -rf dist",
|
|
25
|
-
"build": "npm run clean && tsc",
|
|
25
|
+
"build": "npm run clean && tsc && chmod +x dist/src/cli.js",
|
|
26
26
|
"typecheck": "tsc --noEmit",
|
|
27
27
|
"test": "vitest run --dir test",
|
|
28
28
|
"prepublishOnly": "npm run typecheck && npm run build && npm test"
|
package/dist/src/cli.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
export
|
|
2
|
+
export {};
|
package/dist/src/cli.js
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import process from "node:process";
|
|
3
3
|
import { createInterface } from "node:readline/promises";
|
|
4
|
-
import { pathToFileURL } from "node:url";
|
|
5
4
|
import { Command } from "@commander-js/extra-typings";
|
|
6
5
|
import packageJson from "../package.json" with { type: "json" };
|
|
7
6
|
import { compileToKubeConfig, defaultKubeConfigPath, defaultKubepileDir, splitKubeConfigFile, } from "./kubepile.js";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
7
|
+
const program = createProgram();
|
|
8
|
+
if (process.argv.slice(2).length === 0) {
|
|
9
|
+
program.outputHelp();
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
program.parseAsync(process.argv.slice(2), { from: "user" }).catch((error) => {
|
|
13
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
14
|
+
process.stderr.write(`kubepile: ${message}\n`);
|
|
15
|
+
process.exitCode = 1;
|
|
16
|
+
});
|
|
15
17
|
}
|
|
16
18
|
async function askBackup(existingPath, backupPath) {
|
|
17
19
|
const rl = createInterface({
|
|
@@ -73,11 +75,3 @@ Defaults:
|
|
|
73
75
|
});
|
|
74
76
|
return program;
|
|
75
77
|
}
|
|
76
|
-
const entryPoint = process.argv[1] ? pathToFileURL(process.argv[1]).href : undefined;
|
|
77
|
-
if (import.meta.url === entryPoint) {
|
|
78
|
-
runCli(process.argv.slice(2)).catch((error) => {
|
|
79
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
80
|
-
process.stderr.write(`kubepile: ${message}\n`);
|
|
81
|
-
process.exitCode = 1;
|
|
82
|
-
});
|
|
83
|
-
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kubepile",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "Compile and split kubeconfig files from ~/.config/kubepile.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/src/kubepile.js",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
],
|
|
23
23
|
"scripts": {
|
|
24
24
|
"clean": "rm -rf dist",
|
|
25
|
-
"build": "npm run clean && tsc",
|
|
25
|
+
"build": "npm run clean && tsc && chmod +x dist/src/cli.js",
|
|
26
26
|
"typecheck": "tsc --noEmit",
|
|
27
27
|
"test": "vitest run --dir test",
|
|
28
28
|
"prepublishOnly": "npm run typecheck && npm run build && npm test"
|