@arkhera30/cli 0.3.3 → 0.3.4
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 +34 -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,
|
|
@@ -3014,6 +3038,16 @@ testEnvCommand.command("acquire").description("Start a shadow stack on alternate
|
|
|
3014
3038
|
const dirSpinner = ora8(`Creating slot-${slot} data directories...`).start();
|
|
3015
3039
|
createSlotDirs(slotDataPath);
|
|
3016
3040
|
dirSpinner.succeed(`Data directory: ${chalk10.dim(slotDataPath)}`);
|
|
3041
|
+
const seedSpinner = ora8("Pre-seeding notes directory...").start();
|
|
3042
|
+
try {
|
|
3043
|
+
await preSeedNotesDir(dataDir, slotDataPath);
|
|
3044
|
+
seedSpinner.succeed("Notes directory ready");
|
|
3045
|
+
} catch (error) {
|
|
3046
|
+
seedSpinner.fail(`Notes pre-seed failed: ${error.message}`);
|
|
3047
|
+
removeLock(dataDir, slot);
|
|
3048
|
+
removeSlotDirs(slotDataPath);
|
|
3049
|
+
process.exit(1);
|
|
3050
|
+
}
|
|
3017
3051
|
writeLock(dataDir, {
|
|
3018
3052
|
slot,
|
|
3019
3053
|
pid: process.pid,
|