Updates
This commit is contained in:
+3
-1
@@ -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}' ...`);
|
||||
|
||||
|
||||
@@ -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",
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user