This commit is contained in:
Benjamin Toby
2025-05-29 11:29:29 +01:00
parent accf486151
commit 68c1074de1
9 changed files with 25 additions and 6 deletions
+3 -1
View File
@@ -1,13 +1,15 @@
import { spawn } from "child_process";
import watchFiles from "./watch/files";
import watchFolders from "./watch/folders";
import { TurboSyncConfigObject } from "../types";
const confFileProvidedJSON = process.argv[process.argv.length - 1];
global.SYNCING = false;
try {
const configFileObject = JSON.parse(confFileProvidedJSON);
const configFileObject: TurboSyncConfigObject =
JSON.parse(confFileProvidedJSON);
console.log(`Running '${configFileObject.title}' ...`);
+8 -1
View File
@@ -116,9 +116,15 @@ function sync({ options, dirs, dirPath, init }: SyncFoldersSyncFnParams) {
cmdArray.push("--delete");
}
if (options?.include?.[0]) {
options.include.forEach((excl) => {
cmdArray.push(`--include='${excl}'`);
});
}
if (options?.exclude?.[0]) {
options.exclude.forEach((excl) => {
cmdArray.push(`--exclude '${excl}'`);
cmdArray.push(`--exclude='${excl}'`);
});
}
@@ -138,6 +144,7 @@ function sync({ options, dirs, dirPath, init }: SyncFoldersSyncFnParams) {
path.normalize(dstDr) + "/"
);
const cmd = cmdArray.join(" ");
execSync(cmd, {
stdio: "inherit",
});