Updates
This commit is contained in:
Vendored
+1
@@ -2,4 +2,5 @@ export default function grabDirNames(): {
|
||||
rootDir: string;
|
||||
syncConfigFileName: string;
|
||||
syncConfigFilePath: string;
|
||||
ignoreFileName: string;
|
||||
};
|
||||
|
||||
Vendored
+2
-1
@@ -9,5 +9,6 @@ function grabDirNames() {
|
||||
const rootDir = process.cwd();
|
||||
const syncConfigFileName = "__trsyc.json";
|
||||
const syncConfigFilePath = path_1.default.join(rootDir, syncConfigFileName);
|
||||
return { rootDir, syncConfigFileName, syncConfigFilePath };
|
||||
const ignoreFileName = "turbosync.ignore";
|
||||
return { rootDir, syncConfigFileName, syncConfigFilePath, ignoreFileName };
|
||||
}
|
||||
|
||||
Vendored
+6
@@ -17,6 +17,7 @@ const fs_1 = __importDefault(require("fs"));
|
||||
const path_1 = __importDefault(require("path"));
|
||||
const util_1 = __importDefault(require("util"));
|
||||
const child_process_1 = require("child_process");
|
||||
const grab_dir_names_1 = __importDefault(require("./grab-dir-names"));
|
||||
const execPromise = util_1.default.promisify(child_process_1.exec);
|
||||
function sync(_a) {
|
||||
return __awaiter(this, arguments, void 0, function* ({ options, dirs, dirPath, isFiles, firstRun, }) {
|
||||
@@ -28,6 +29,8 @@ function sync(_a) {
|
||||
return dr.path !== dirPath;
|
||||
return false;
|
||||
});
|
||||
const { ignoreFileName } = (0, grab_dir_names_1.default)();
|
||||
const rsyncIgnoreFile = path_1.default.join(dirPath, ignoreFileName);
|
||||
const rsyncTrailingSlash = isFiles ? "" : "/";
|
||||
const allCommandsArr = [];
|
||||
for (let j = 0; j < dstDirs.length; j++) {
|
||||
@@ -41,6 +44,9 @@ function sync(_a) {
|
||||
cmdArray.push(`--include='${incl}'`);
|
||||
});
|
||||
}
|
||||
if (fs_1.default.existsSync(rsyncIgnoreFile)) {
|
||||
cmdArray.push(`--exclude-from=${rsyncIgnoreFile}`);
|
||||
}
|
||||
if ((_c = options === null || options === void 0 ? void 0 : options.exclude) === null || _c === void 0 ? void 0 : _c[0]) {
|
||||
options.exclude.forEach((excl) => {
|
||||
cmdArray.push(`--exclude='${excl}'`);
|
||||
|
||||
Reference in New Issue
Block a user