Compare commits
No commits in common. "975d6b6fd47f2d9354514e2adcd8f4cada83952f" and "b213bef04032791d0c266c94c8e2ee80a21ad254" have entirely different histories.
975d6b6fd4
...
b213bef040
@ -10,10 +10,3 @@ SETUP
|
|||||||
npm install
|
npm install
|
||||||
npm install -g .
|
npm install -g .
|
||||||
```
|
```
|
||||||
|
|
||||||
UNINSTALL
|
|
||||||
---------
|
|
||||||
|
|
||||||
```
|
|
||||||
npm uninstall -g
|
|
||||||
```
|
|
||||||
|
|||||||
21
index.js
21
index.js
@ -12,13 +12,6 @@ const yaml = require("yaml");
|
|||||||
const rawArgs = process.argv.slice(2);
|
const rawArgs = process.argv.slice(2);
|
||||||
const asJSON = rawArgs.includes("--json");
|
const asJSON = rawArgs.includes("--json");
|
||||||
const asMarkdown = rawArgs.includes("--markdown");
|
const asMarkdown = rawArgs.includes("--markdown");
|
||||||
if (rawArgs.includes("--help")) {
|
|
||||||
process.stdout.write(`USAGE: ${path.basename(process.argv[0])} {search}
|
|
||||||
--json - format as JSON
|
|
||||||
--markdown - format as Markdown table
|
|
||||||
--help - show help\n`)
|
|
||||||
process.exit(0)
|
|
||||||
}
|
|
||||||
const query = rawArgs.find(arg => !arg.startsWith("--")) || null;
|
const query = rawArgs.find(arg => !arg.startsWith("--")) || null;
|
||||||
|
|
||||||
// === CONFIG SEARCH ===
|
// === CONFIG SEARCH ===
|
||||||
@ -46,7 +39,7 @@ function findTeaConfig() {
|
|||||||
function loadGiteaLogin() {
|
function loadGiteaLogin() {
|
||||||
const configPath = findTeaConfig();
|
const configPath = findTeaConfig();
|
||||||
if (!configPath) {
|
if (!configPath) {
|
||||||
console.error("Could not find tea config.yml or tea.yml");
|
console.error("❌ Could not find tea config.yml or tea.yml");
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -55,16 +48,16 @@ function loadGiteaLogin() {
|
|||||||
const logins = parsed.logins || [];
|
const logins = parsed.logins || [];
|
||||||
|
|
||||||
if (logins.length === 0) {
|
if (logins.length === 0) {
|
||||||
console.error("No logins found in config");
|
console.error("❌ No logins found in config");
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
const login = logins.find((l) => l.default) || logins[0];
|
const login = logins.find((l) => l.default) || logins[0];
|
||||||
|
|
||||||
debug(`Using config: ${configPath}`);
|
debug(`🔧 Using config: ${configPath}`);
|
||||||
debug(`Gitea user: ${login.user}`);
|
debug(`👤 Gitea user: ${login.user}`);
|
||||||
debug(`Gitea URL: ${login.url}`);
|
debug(`🌐 Gitea URL: ${login.url}`);
|
||||||
debug(`Auth token: ${login.token ? '[present]' : '[missing]'}`);
|
debug(`🔐 Auth token: ${login.token ? '[present]' : '[missing]'}`);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
baseUrl: login.url.replace(/\/$/, ""),
|
baseUrl: login.url.replace(/\/$/, ""),
|
||||||
@ -140,7 +133,7 @@ async function listPackages() {
|
|||||||
printPlain(packages);
|
printPlain(packages);
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error("Error:", err.message);
|
console.error("❌ Error:", err.message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user