btca 0.3.2 → 0.3.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/dist/btca-darwin-arm64 +0 -0
- package/dist/btca-darwin-x64 +0 -0
- package/dist/btca-linux-arm64 +0 -0
- package/dist/btca-linux-x64 +0 -0
- package/dist/btca-windows-x64.exe +0 -0
- package/dist/index.js +81 -8
- package/package.json +1 -1
package/dist/btca-darwin-arm64
CHANGED
|
Binary file
|
package/dist/btca-darwin-x64
CHANGED
|
Binary file
|
package/dist/btca-linux-arm64
CHANGED
|
Binary file
|
package/dist/btca-linux-x64
CHANGED
|
Binary file
|
|
Binary file
|
package/dist/index.js
CHANGED
|
@@ -60652,6 +60652,14 @@ var configService = exports_Effect.gen(function* () {
|
|
|
60652
60652
|
yield* writeConfig(config2);
|
|
60653
60653
|
return repo;
|
|
60654
60654
|
}),
|
|
60655
|
+
removeRepo: (repoName) => exports_Effect.gen(function* () {
|
|
60656
|
+
const existing = config2.repos.find((r) => r.name === repoName);
|
|
60657
|
+
if (!existing) {
|
|
60658
|
+
return yield* exports_Effect.fail(new ConfigError({ message: `Repo "${repoName}" not found` }));
|
|
60659
|
+
}
|
|
60660
|
+
config2 = { ...config2, repos: config2.repos.filter((r) => r.name !== repoName) };
|
|
60661
|
+
yield* writeConfig(config2);
|
|
60662
|
+
}),
|
|
60655
60663
|
getReposDirectory: () => exports_Effect.succeed(config2.reposDirectory)
|
|
60656
60664
|
};
|
|
60657
60665
|
});
|
|
@@ -60833,7 +60841,7 @@ class OcService extends exports_Effect.Service()("OcService", {
|
|
|
60833
60841
|
}
|
|
60834
60842
|
|
|
60835
60843
|
// src/services/cli.ts
|
|
60836
|
-
var VERSION = "0.3.
|
|
60844
|
+
var VERSION = "0.3.3";
|
|
60837
60845
|
var programLayer = exports_Layer.mergeAll(OcService.Default, ConfigService.Default);
|
|
60838
60846
|
var questionOption = exports_Options.text("question").pipe(exports_Options.withAlias("q"));
|
|
60839
60847
|
var techOption = exports_Options.text("tech").pipe(exports_Options.withAlias("t"));
|
|
@@ -60971,21 +60979,41 @@ var repoUrlOption = exports_Options.text("url").pipe(exports_Options.withAlias("
|
|
|
60971
60979
|
var repoBranchOption = exports_Options.text("branch").pipe(exports_Options.withAlias("b"), exports_Options.withDefault("main"));
|
|
60972
60980
|
var repoNotesOption = exports_Options.text("notes").pipe(exports_Options.optional);
|
|
60973
60981
|
var configReposAddCommand = exports_Command2.make("add", {
|
|
60974
|
-
name: repoNameOption,
|
|
60975
|
-
url: repoUrlOption,
|
|
60982
|
+
name: repoNameOption.pipe(exports_Options.optional),
|
|
60983
|
+
url: repoUrlOption.pipe(exports_Options.optional),
|
|
60976
60984
|
branch: repoBranchOption,
|
|
60977
60985
|
notes: repoNotesOption
|
|
60978
60986
|
}, ({ name, url: url2, branch, notes }) => exports_Effect.gen(function* () {
|
|
60979
60987
|
const config2 = yield* ConfigService;
|
|
60988
|
+
let repoName;
|
|
60989
|
+
if (name._tag === "Some") {
|
|
60990
|
+
repoName = name.value;
|
|
60991
|
+
} else {
|
|
60992
|
+
repoName = yield* askText("Enter repo name: ");
|
|
60993
|
+
}
|
|
60994
|
+
if (!repoName) {
|
|
60995
|
+
console.log("No repo name provided.");
|
|
60996
|
+
return;
|
|
60997
|
+
}
|
|
60998
|
+
let repoUrl;
|
|
60999
|
+
if (url2._tag === "Some") {
|
|
61000
|
+
repoUrl = url2.value;
|
|
61001
|
+
} else {
|
|
61002
|
+
repoUrl = yield* askText("Enter repo URL: ");
|
|
61003
|
+
}
|
|
61004
|
+
if (!repoUrl) {
|
|
61005
|
+
console.log("No repo URL provided.");
|
|
61006
|
+
return;
|
|
61007
|
+
}
|
|
60980
61008
|
const repo = {
|
|
60981
|
-
name,
|
|
60982
|
-
url:
|
|
61009
|
+
name: repoName,
|
|
61010
|
+
url: repoUrl,
|
|
60983
61011
|
branch,
|
|
60984
61012
|
...notes._tag === "Some" ? { specialNotes: notes.value } : {}
|
|
60985
61013
|
};
|
|
60986
61014
|
yield* config2.addRepo(repo);
|
|
60987
|
-
console.log(`Added repo "${
|
|
60988
|
-
console.log(` URL: ${
|
|
61015
|
+
console.log(`Added repo "${repoName}":`);
|
|
61016
|
+
console.log(` URL: ${repoUrl}`);
|
|
60989
61017
|
console.log(` Branch: ${branch}`);
|
|
60990
61018
|
if (notes._tag === "Some") {
|
|
60991
61019
|
console.log(` Notes: ${notes.value}`);
|
|
@@ -61005,6 +61033,45 @@ var askConfirmation = (question) => exports_Effect.async((resume2) => {
|
|
|
61005
61033
|
resume2(exports_Effect.succeed(normalized === "y" || normalized === "yes"));
|
|
61006
61034
|
});
|
|
61007
61035
|
});
|
|
61036
|
+
var askText = (question) => exports_Effect.async((resume2) => {
|
|
61037
|
+
const rl = readline2.createInterface({
|
|
61038
|
+
input: process.stdin,
|
|
61039
|
+
output: process.stdout
|
|
61040
|
+
});
|
|
61041
|
+
rl.question(question, (answer) => {
|
|
61042
|
+
rl.close();
|
|
61043
|
+
resume2(exports_Effect.succeed(answer.trim()));
|
|
61044
|
+
});
|
|
61045
|
+
});
|
|
61046
|
+
var configReposRemoveCommand = exports_Command2.make("remove", { name: repoNameOption.pipe(exports_Options.optional) }, ({ name }) => exports_Effect.gen(function* () {
|
|
61047
|
+
const config2 = yield* ConfigService;
|
|
61048
|
+
let repoName;
|
|
61049
|
+
if (name._tag === "Some") {
|
|
61050
|
+
repoName = name.value;
|
|
61051
|
+
} else {
|
|
61052
|
+
repoName = yield* askText("Enter repo name to remove: ");
|
|
61053
|
+
}
|
|
61054
|
+
if (!repoName) {
|
|
61055
|
+
console.log("No repo name provided.");
|
|
61056
|
+
return;
|
|
61057
|
+
}
|
|
61058
|
+
const repos = yield* config2.getRepos();
|
|
61059
|
+
const exists5 = repos.find((r) => r.name === repoName);
|
|
61060
|
+
if (!exists5) {
|
|
61061
|
+
console.error(`Error: Repo "${repoName}" not found.`);
|
|
61062
|
+
process.exit(1);
|
|
61063
|
+
}
|
|
61064
|
+
const confirmed = yield* askConfirmation(`Are you sure you want to remove repo "${repoName}" from config? (y/N): `);
|
|
61065
|
+
if (!confirmed) {
|
|
61066
|
+
console.log("Aborted.");
|
|
61067
|
+
return;
|
|
61068
|
+
}
|
|
61069
|
+
yield* config2.removeRepo(repoName);
|
|
61070
|
+
console.log(`Removed repo "${repoName}".`);
|
|
61071
|
+
}).pipe(exports_Effect.catchTag("ConfigError", (e) => exports_Effect.sync(() => {
|
|
61072
|
+
console.error(`Error: ${e.message}`);
|
|
61073
|
+
process.exit(1);
|
|
61074
|
+
})), exports_Effect.provide(programLayer)));
|
|
61008
61075
|
var configReposClearCommand = exports_Command2.make("clear", {}, () => exports_Effect.gen(function* () {
|
|
61009
61076
|
const config2 = yield* ConfigService;
|
|
61010
61077
|
const fs = yield* exports_FileSystem.FileSystem;
|
|
@@ -61051,8 +61118,14 @@ var configReposCommand = exports_Command2.make("repos", {}, () => exports_Effect
|
|
|
61051
61118
|
console.log("Commands:");
|
|
61052
61119
|
console.log(" list List all configured repos");
|
|
61053
61120
|
console.log(" add Add a new repo");
|
|
61121
|
+
console.log(" remove Remove a configured repo");
|
|
61054
61122
|
console.log(" clear Clear all downloaded repos");
|
|
61055
|
-
})).pipe(exports_Command2.withSubcommands([
|
|
61123
|
+
})).pipe(exports_Command2.withSubcommands([
|
|
61124
|
+
configReposListCommand,
|
|
61125
|
+
configReposAddCommand,
|
|
61126
|
+
configReposRemoveCommand,
|
|
61127
|
+
configReposClearCommand
|
|
61128
|
+
]));
|
|
61056
61129
|
var configCommand = exports_Command2.make("config", {}, () => exports_Effect.gen(function* () {
|
|
61057
61130
|
const config2 = yield* ConfigService;
|
|
61058
61131
|
const configPath = yield* config2.getConfigPath();
|