Skip to content

Commit

Permalink
scripts: gceworker: don't anchor absolute paths at repo in get
Browse files Browse the repository at this point in the history
Now one may `./scripts/gceworker.ssh get /home/foo bar`.
Previously it would try to copy from
`go/src/github.com/cockroachdb/cockroach/home/foo/bar`.

Epic: none
Release note: None
  • Loading branch information
tbg committed Feb 16, 2023
1 parent 5f85453 commit 9bb7478
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scripts/gceworker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,12 @@ case "${cmd}" in
gcloud "$@"
;;
get)
from="${NAME}:go/src/github.com/cockroachdb/cockroach/${1}"
rpath="${1}"
if [[ "${rpath}" != /* ]]; then
# Relative paths are relative to main repo.
rpath="go/src/github.com/cockroachdb/cockroach/${rpath}"
fi
from="${NAME}:${rpath}"
shift
gcloud compute scp --recurse "${from}" "$@"
;;
Expand Down

0 comments on commit 9bb7478

Please sign in to comment.