Skip to content

Commit

Permalink
I noticed git went from 50MB to 2GB…
Browse files Browse the repository at this point in the history
  • Loading branch information
mxcl committed Jan 31, 2024
1 parent 07f3e9d commit 60879ef
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,17 @@ export function find_in_PATH(program: string) {
export async function rsync(from: Path, to: Path, additional_args: string[] = []) {
console.log(`rsync ${from.string} ${to.string}`)
to.parent().mkdir('p')
const v = Deno.env.get("VERBOSE") ? 'v' : ''
const args = [`-a${v}`, '--delete', ...additional_args, `${from.string}/`, to.string]
const args = [
'--archive',
'--hard-links', // or hard links get broken in the result
'--delete']
if (Deno.env.get("VERBOSE")) {
args.push('--verbose')
}
args.push(
...additional_args,
`${from.string}/`,
to.string)
const {success} = await new Deno.Command("rsync", {args}).spawn().status
if (!success) throw new Error("rsync failed")
}

0 comments on commit 60879ef

Please sign in to comment.