diff --git a/lib/rbpkg.rb b/lib/rbpkg.rb
index 5924cd7..36a42ca 100644
--- a/lib/rbpkg.rb
+++ b/lib/rbpkg.rb
@@ -209,7 +209,10 @@ EOF
verbose(3, "Rbpkg.ci_remote(#{repo.inspect}, #{branch.inspect}, #{commit.inspect}, #{host.inspect})")
sh_host = sh_quote(host)
cmd "ssh #{sh_host} rbpkg/bin/rbpkg_ci #{sh_quote(repo)} #{sh_quote(branch)} #{sh_quote(commit)}"
- sh_ci_dir = "rbpkg/ci"
+ sh_ci_dir = sh_quote(ci_dir)
+ if `ssh ${sh_host} uname`.strip == "Darwin"
+ sh_ci_dir = sh_ci_dir.gsub(~s|^/home/|, "/Users/")
+ end
cmd! "rsync -a --exclude build #{sh_host}:#{sh_ci_dir}/. #{sh_ci_dir}"
end