422 |
422 |
423 def rsync( |
423 def rsync( |
424 cwd: JFile = null, |
424 cwd: JFile = null, |
425 progress: Progress = new Progress, |
425 progress: Progress = new Progress, |
426 verbose: Boolean = false, |
426 verbose: Boolean = false, |
|
427 thorough: Boolean = false, |
427 dry_run: Boolean = false, |
428 dry_run: Boolean = false, |
428 clean: Boolean = false, |
429 clean: Boolean = false, |
429 filter: List[String] = Nil, |
430 filter: List[String] = Nil, |
430 args: List[String] = Nil |
431 args: List[String] = Nil |
431 ): Unit = { |
432 ): Unit = { |
432 val script = |
433 val script = |
433 "rsync --protect-args --archive" + |
434 "rsync --protect-args --archive" + |
434 (if (verbose || dry_run) " --verbose" else "") + |
435 (if (verbose || dry_run) " --verbose" else "") + |
|
436 (if (thorough) " --ignore-times" else "") + |
435 (if (dry_run) " --dry-run" else "") + |
437 (if (dry_run) " --dry-run" else "") + |
436 (if (clean) " --delete-excluded" else "") + |
438 (if (clean) " --delete-excluded" else "") + |
437 filter.map(s => " --filter=" + Bash.string(s)).mkString + |
439 filter.map(s => " --filter=" + Bash.string(s)).mkString + |
438 (if (args.nonEmpty) " " + Bash.strings(args) else "") |
440 (if (args.nonEmpty) " " + Bash.strings(args) else "") |
439 progress.bash(script, cwd = cwd, echo = true).check |
441 progress.bash(script, cwd = cwd, echo = true).check |