2
0
mirror of https://github.com/bpkg/bpkg synced 2024-11-17 21:26:01 +00:00

fix(install.sh,run.sh): fix output

This commit is contained in:
jwerle 2022-03-18 15:07:12 -04:00 committed by Joseph Werle
parent 1d6eeb6529
commit dfb978c167
2 changed files with 7 additions and 8 deletions

View File

@ -414,20 +414,20 @@ bpkg_install_from_remote () {
{(
## go to tmp dir
cd "$([[ -n "$TMPDIR" ]] && echo "$TMPDIR" || echo /tmp)" &&
cd "$([[ -n "$TMPDIR" ]] && echo "$TMPDIR" || echo /tmp)" || return $?
## prune existing
( (( 0 == prevent_prune )) && rm -rf "$name-$version" || true) &&
( (( 0 == prevent_prune )) && rm -rf "$name-$version")
## shallow clone
info "Cloning $repo_url to $(pwd)/$name-$version"
(test -d "$name-$version" || git clone "$repo_url" "$name-$version") && (
(test -d "$name-$version" || git clone "$repo_url" "$name-$version" 2>/dev/null) && (
## move into directory
cd "$name-$version" && (
## checkout to branch version or checkout into
## branch 'main' just in case 'master' was renamed
git checkout "$version" ||
git checkout "$version" 2>/dev/null ||
([ "$version" = "master" ] && git checkout main 2>/dev/null) ||
(git checkout master)
(git checkout master 2>/dev/null)
)
## build

View File

@ -97,12 +97,11 @@ bpkg_run () {
done
if (( 0 == should_clean )); then
dest=$(bpkg_install --no-prune -g "$1" 2>/dev/null | grep 'info: Cloning' | sed 's/.* to //g' | xargs echo)
dest=$(bpkg_install --no-prune -g "$1" 2>/dev/null | grep 'Cloning' | sed 's/.* to //g' | xargs echo)
else
dest=$(bpkg_install -g "$1" 2>/dev/null | grep 'info: Cloning' | sed 's/.* to //g' | xargs echo)
dest=$(bpkg_install -g "$1" 2>/dev/null | grep 'Cloning' | sed 's/.* to //g' | xargs echo)
fi
if [ -z "$dest" ]; then return $?; fi
cd "$dest" || return $?