Skip to content

Commit

Permalink
fix: rsync issue with windows gitbash
Browse files Browse the repository at this point in the history
  • Loading branch information
ANGkeith committed Oct 15, 2024
1 parent 503a0e9 commit 074f55c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,11 @@ ${evalStr}
static async rsyncTrackedFiles (cwd: string, stateDir: string, target: string): Promise<{hrdeltatime: [number, number]}> {
const time = process.hrtime();
await fs.mkdirp(`${cwd}/${stateDir}/builds/${target}`);
await Utils.bash(`rsync -a --delete-excluded --delete --exclude-from=<(git ls-files -o --directory | awk '{print "/"$0}') --exclude ${stateDir}/ ./ ${stateDir}/builds/${target}/`, cwd);
const _excludedGitUntrackedFolders = (await Utils.spawn("git ls-files -o --directory".split(" "), cwd)).stdout;
const excludedGitUntrackedFolders = _excludedGitUntrackedFolders
.split("\n")
.map(line => `--exclude=/${line}`);
await Utils.spawn(["rsync", "-a", "--delete-excluded", "--delete", `--exclude=/${stateDir}/`, "./", `${stateDir}/builds/${target}/`].concat(excludedGitUntrackedFolders), cwd);
return {hrdeltatime: process.hrtime(time)};
}

Expand Down

0 comments on commit 074f55c

Please sign in to comment.