Skip to content

Commit

Permalink
fix(wrapper): move cd up in compose wrappers (#11)
Browse files Browse the repository at this point in the history
* fix(wrapper): move cd up

* chore: update version
  • Loading branch information
nuxencs authored Oct 28, 2023
1 parent 20aa51c commit a323aae
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pullio.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -39,14 +39,14 @@ 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"
else
"${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
Expand All @@ -56,14 +56,14 @@ 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"
else
"${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
Expand Down

0 comments on commit a323aae

Please sign in to comment.