@arkhera30/cli 0.3.3 → 0.3.5
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 +35 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2854,6 +2854,30 @@ function removeSlotDirs(slotDataPath) {
|
|
|
2854
2854
|
rmSync(slotDataPath, { recursive: true, force: true });
|
|
2855
2855
|
}
|
|
2856
2856
|
}
|
|
2857
|
+
async function preSeedNotesDir(dataDir, slotDataPath) {
|
|
2858
|
+
const srcNotesPath = join7(dataDir, "notes");
|
|
2859
|
+
const destNotesPath = join7(slotDataPath, "notes");
|
|
2860
|
+
if (existsSync9(join7(srcNotesPath, ".git"))) {
|
|
2861
|
+
if (existsSync9(destNotesPath)) {
|
|
2862
|
+
rmSync(destNotesPath, { recursive: true });
|
|
2863
|
+
}
|
|
2864
|
+
await execa3("git", ["clone", "--local", srcNotesPath, destNotesPath]);
|
|
2865
|
+
} else {
|
|
2866
|
+
await execa3("git", ["-C", destNotesPath, "init"]);
|
|
2867
|
+
await execa3("git", [
|
|
2868
|
+
"-C",
|
|
2869
|
+
destNotesPath,
|
|
2870
|
+
"-c",
|
|
2871
|
+
"user.email=horus@local",
|
|
2872
|
+
"-c",
|
|
2873
|
+
"user.name=Horus",
|
|
2874
|
+
"commit",
|
|
2875
|
+
"--allow-empty",
|
|
2876
|
+
"-m",
|
|
2877
|
+
"init"
|
|
2878
|
+
]);
|
|
2879
|
+
}
|
|
2880
|
+
}
|
|
2857
2881
|
function buildComposeEnv(runtime, ports, slotDataPath) {
|
|
2858
2882
|
return {
|
|
2859
2883
|
...process.env,
|
|
@@ -2869,6 +2893,7 @@ function buildComposeEnv(runtime, ports, slotDataPath) {
|
|
|
2869
2893
|
VAULT_ROUTER_PORT: String(ports.vault_router),
|
|
2870
2894
|
VAULT_REST_PORT_PERSONAL: String(ports.vault_svc),
|
|
2871
2895
|
TYPESENSE_PORT: String(ports.typesense),
|
|
2896
|
+
UI_PORT: String(ports.ui),
|
|
2872
2897
|
// TEST_PORT_* vars for overlay reference (harmless duplicates after above fix)
|
|
2873
2898
|
TEST_PORT_ANVIL: String(ports.anvil),
|
|
2874
2899
|
TEST_PORT_TYPESENSE: String(ports.typesense),
|
|
@@ -3014,6 +3039,16 @@ testEnvCommand.command("acquire").description("Start a shadow stack on alternate
|
|
|
3014
3039
|
const dirSpinner = ora8(`Creating slot-${slot} data directories...`).start();
|
|
3015
3040
|
createSlotDirs(slotDataPath);
|
|
3016
3041
|
dirSpinner.succeed(`Data directory: ${chalk10.dim(slotDataPath)}`);
|
|
3042
|
+
const seedSpinner = ora8("Pre-seeding notes directory...").start();
|
|
3043
|
+
try {
|
|
3044
|
+
await preSeedNotesDir(dataDir, slotDataPath);
|
|
3045
|
+
seedSpinner.succeed("Notes directory ready");
|
|
3046
|
+
} catch (error) {
|
|
3047
|
+
seedSpinner.fail(`Notes pre-seed failed: ${error.message}`);
|
|
3048
|
+
removeLock(dataDir, slot);
|
|
3049
|
+
removeSlotDirs(slotDataPath);
|
|
3050
|
+
process.exit(1);
|
|
3051
|
+
}
|
|
3017
3052
|
writeLock(dataDir, {
|
|
3018
3053
|
slot,
|
|
3019
3054
|
pid: process.pid,
|