Skip to content
This repository was archived by the owner on Jul 14, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@octomind/octomind",
"version": "3.8.0",
"version": "3.8.1",
"description": "a command line client for octomind apis",
"main": "./dist/index.js",
"packageManager": "pnpm@10.26.0+sha512.3b3f6c725ebe712506c0ab1ad4133cf86b1f4b687effce62a9b38b4d72e3954242e643190fc51fa1642949c735f403debd44f5cb0edd657abe63a8b6a7e1e402",
Expand Down
13 changes: 11 additions & 2 deletions src/tools/sync/yml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,14 +192,20 @@ export const cleanupFilesystem = ({
newTestCases: SyncTestCase[];
destination: string | undefined;
}) => {
const rootFolderPath = destination ?? "./";
const rootFolderPath = destination ?? process.cwd();

const existingtestCases = readTestCasesFromDir(rootFolderPath);

const existingTestCasesById = new Map(
existingtestCases.map((tc) => [tc.id, tc]),
);

// There is generally a bigger issue here:
// We need a better check what changed locally.
// Imagine you rename a test case remotely, and then you locally change steps in child test case.
// Then you pull, and you local changes will just be deleted.
// Same applies for changing the dependency, as it will be in a different folder. We also don't clean up these folders properly.

for (const testCase of newTestCases) {
const existingTestCase = existingTestCasesById.get(testCase.id);
if (existingTestCase) {
Expand All @@ -211,9 +217,12 @@ export const cleanupFilesystem = ({
rootFolderPath,
existingTestCasePath.replace(/\.yaml$/, ""),
);
const oldFilePath = path.join(rootFolderPath, existingTestCasePath);

if (existingTestCase.description !== testCase.description) {
fs.unlinkSync(path.join(rootFolderPath, existingTestCasePath));
if (fs.existsSync(oldFilePath)) {
fs.unlinkSync(oldFilePath);
}

if (fs.existsSync(oldFolderPath)) {
fs.rmSync(oldFolderPath, { recursive: true, force: true });
Expand Down