From a323aaea12bf22554531b3c778d1b04445b5a31d Mon Sep 17 00:00:00 2001 From: nuxen <47067662+nuxencs@users.noreply.github.com> Date: Sat, 28 Oct 2023 13:29:12 +0200 Subject: [PATCH] fix(wrapper): move cd up in compose wrappers (#11) * fix(wrapper): move cd up * chore: update version --- pullio.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pullio.sh b/pullio.sh index a1ea813..8517c5f 100755 --- a/pullio.sh +++ b/pullio.sh @@ -5,7 +5,7 @@ DOCKER_BINARY="${DOCKER_BINARY:-$(which 'docker')}" CACHE_LOCATION=/tmp TAG="" DEBUG="" -CURRENT_VERSION=0.0.5 +CURRENT_VERSION=0.0.6 LATEST_VERSION=$(curl -fsSL "https://api.github.com/repos/hotio/pullio/releases" | jq -r .[0].tag_name) if ! docker compose version >/dev/null 2>&1; then @@ -39,6 +39,7 @@ echo "Current version: ${CURRENT_VERSION}" echo "Latest version: ${LATEST_VERSION}" compose_pull_wrapper() { + cd "$1" || exit 1 if [[ -z ${COMPOSE_BINARY} ]]; then if [[ "${COMPOSE_V2}" == "1" ]]; then "${DOCKER_BINARY}" compose pull "$2" @@ -46,7 +47,6 @@ compose_pull_wrapper() { "${DOCKER_BINARY}" run --rm -v /var/run/docker.sock:/var/run/docker.sock -v "$1:$1" -w="$1" linuxserver/docker-compose pull "$2" fi else - cd "$1" || exit 1 if [[ "${COMPOSE_V2}" == "1" ]]; then "${DOCKER_BINARY}" compose pull "$2" else @@ -56,6 +56,7 @@ compose_pull_wrapper() { } compose_up_wrapper() { + cd "$1" || exit 1 if [[ -z ${COMPOSE_BINARY} ]]; then if [[ "${COMPOSE_V2}" == "1" ]]; then "${DOCKER_BINARY}" compose up -d --always-recreate-deps "$2" @@ -63,7 +64,6 @@ compose_up_wrapper() { "${DOCKER_BINARY}" run --rm -v /var/run/docker.sock:/var/run/docker.sock -v "$1:$1" -w="$1" linuxserver/docker-compose up -d --always-recreate-deps "$2" fi else - cd "$1" || exit 1 if [[ "${COMPOSE_V2}" == "1" ]]; then "${DOCKER_BINARY}" compose up -d --always-recreate-deps "$2" else