@robineb/project-cli 1.0.0 → 1.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/index.js
CHANGED
|
@@ -95,7 +95,10 @@ async function ask(message) {
|
|
|
95
95
|
return answer;
|
|
96
96
|
}
|
|
97
97
|
async function askText(message) {
|
|
98
|
-
const answer = await p.text({
|
|
98
|
+
const answer = await p.text({
|
|
99
|
+
message,
|
|
100
|
+
validate: (value) => (value?.trim() ? undefined : "Darf nicht leer sein."),
|
|
101
|
+
});
|
|
99
102
|
if (p.isCancel(answer))
|
|
100
103
|
throw new Error("Abgebrochen.");
|
|
101
104
|
return answer;
|
|
@@ -109,12 +112,14 @@ async function resolveGitHubToken() {
|
|
|
109
112
|
return token;
|
|
110
113
|
}
|
|
111
114
|
async function resolveGiteaCredentials() {
|
|
112
|
-
|
|
115
|
+
// Leerer String zählt als "nicht vorhanden" (z.B. ein früherer Lauf hat
|
|
116
|
+
// versehentlich "" gespeichert) -> nicht nur auf null/undefined prüfen.
|
|
117
|
+
const existingUrl = process.env.GITEA_URL || config.get("giteaUrl") || undefined;
|
|
113
118
|
const baseUrl = existingUrl ??
|
|
114
119
|
(await askText("Gitea-URL (z.B. https://gitea.example.com)"));
|
|
115
120
|
if (!existingUrl)
|
|
116
121
|
config.set("giteaUrl", baseUrl);
|
|
117
|
-
const existingToken = process.env.GITEA_TOKEN
|
|
122
|
+
const existingToken = process.env.GITEA_TOKEN || getStoredSecret("gitea-token") || undefined;
|
|
118
123
|
const token = existingToken ?? (await ask("Gitea Access Token (write:repository-Scope)"));
|
|
119
124
|
if (!existingToken)
|
|
120
125
|
setStoredSecret("gitea-token", token);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# {{projectName}}
|
|
2
|
-
|
|
3
|
-
## Entwicklung
|
|
4
|
-
|
|
5
|
-
npm install
|
|
1
|
+
# {{projectName}}
|
|
2
|
+
|
|
3
|
+
## Entwicklung
|
|
4
|
+
|
|
5
|
+
npm install
|
|
6
6
|
npm run dev
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "{{projectName}}",
|
|
3
|
-
"version": "0.1.0",
|
|
4
|
-
"type": "module",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"build": "tsc",
|
|
8
|
-
"dev": "node --watch src/index.ts"
|
|
9
|
-
},
|
|
10
|
-
"devDependencies": {
|
|
11
|
-
"@types/node": "^26.0.0",
|
|
12
|
-
"typescript": "^5.7.0"
|
|
13
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "{{projectName}}",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "tsc",
|
|
8
|
+
"dev": "node --watch src/index.ts"
|
|
9
|
+
},
|
|
10
|
+
"devDependencies": {
|
|
11
|
+
"@types/node": "^26.0.0",
|
|
12
|
+
"typescript": "^5.7.0"
|
|
13
|
+
}
|
|
14
14
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2022",
|
|
4
|
-
"module": "nodenext",
|
|
5
|
-
"moduleResolution": "nodenext",
|
|
6
|
-
"types": ["node"],
|
|
7
|
-
"strict": true,
|
|
8
|
-
"outDir": "dist",
|
|
9
|
-
"rootDir": "src"
|
|
10
|
-
},
|
|
11
|
-
"include": ["src/**/*.ts"],
|
|
12
|
-
"exclude": ["node_modules", "dist"]
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "nodenext",
|
|
5
|
+
"moduleResolution": "nodenext",
|
|
6
|
+
"types": ["node"],
|
|
7
|
+
"strict": true,
|
|
8
|
+
"outDir": "dist",
|
|
9
|
+
"rootDir": "src"
|
|
10
|
+
},
|
|
11
|
+
"include": ["src/**/*.ts"],
|
|
12
|
+
"exclude": ["node_modules", "dist"]
|
|
13
13
|
}
|