diff --git a/.github/source_cardano_cli.sh b/.github/source_cardano_cli.sh index 65fd231ed..1c9dcdda8 100644 --- a/.github/source_cardano_cli.sh +++ b/.github/source_cardano_cli.sh @@ -1,6 +1,7 @@ #!/bin/bash -pushd "$WORKDIR" || exit 1 +_origpwd="$PWD" +cd "$WORKDIR" || exit 1 case "${CARDANO_CLI_REV:-""}" in "" ) @@ -15,7 +16,7 @@ case "${CARDANO_CLI_REV:-""}" in git clone --depth 1 https://github.com/IntersectMBO/cardano-cli.git fi - pushd cardano-cli || exit 1 + cd cardano-cli || exit 1 git fetch origin main ;; @@ -24,7 +25,7 @@ case "${CARDANO_CLI_REV:-""}" in git clone https://github.com/IntersectMBO/cardano-cli.git fi - pushd cardano-cli || exit 1 + cd cardano-cli || exit 1 git fetch ;; esac @@ -36,4 +37,5 @@ git rev-parse HEAD nix build --accept-flake-config .#cardano-cli -o cardano-cli-build || exit 1 [ -e cardano-cli-build/bin/cardano-cli ] || exit 1 -pushd "$REPODIR" || exit 1 +cd "$_origpwd" || exit 1 +unset _origpwd diff --git a/.github/source_dbsync.sh b/.github/source_dbsync.sh index 0018aa1ca..28842eb4c 100644 --- a/.github/source_dbsync.sh +++ b/.github/source_dbsync.sh @@ -4,7 +4,8 @@ TEST_THREADS="${TEST_THREADS:-15}" CLUSTERS_COUNT="${CLUSTERS_COUNT:-4}" export TEST_THREADS CLUSTERS_COUNT -pushd "$WORKDIR" || exit 1 +_origpwd="$PWD" +cd "$WORKDIR" || exit 1 stop_postgres() { echo "Stopping postgres" @@ -57,7 +58,7 @@ case "${DBSYNC_REV:-""}" in git clone --depth 1 https://github.com/IntersectMBO/cardano-db-sync.git fi - pushd cardano-db-sync || exit 1 + cd cardano-db-sync || exit 1 git fetch origin master ;; @@ -66,7 +67,7 @@ case "${DBSYNC_REV:-""}" in git clone https://github.com/IntersectMBO/cardano-db-sync.git fi - pushd cardano-db-sync || exit 1 + cd cardano-db-sync || exit 1 git fetch ;; esac @@ -112,7 +113,7 @@ fi [ -e db-sync-node/bin/cardano-db-sync ] || exit 1 export DBSYNC_REPO="$PWD" -pushd "$REPODIR" || exit 1 +cd "$REPODIR" || exit 1 # set postgres env variables export PGHOST=localhost @@ -121,3 +122,6 @@ export PGPORT=5432 # start and setup postgres ./scripts/postgres-start.sh "$WORKDIR/postgres" -k + +cd "$_origpwd" || exit 1 +unset _origpwd diff --git a/.github/source_plutus_apps.sh b/.github/source_plutus_apps.sh index 4895a920d..b23e78b2d 100644 --- a/.github/source_plutus_apps.sh +++ b/.github/source_plutus_apps.sh @@ -1,6 +1,7 @@ #!/bin/bash -pushd "$WORKDIR" || exit 1 +_origpwd="$PWD" +cd "$WORKDIR" || exit 1 case "${PLUTUS_APPS_REV:-""}" in "" ) @@ -15,7 +16,7 @@ case "${PLUTUS_APPS_REV:-""}" in git clone --depth 1 --recurse-submodules --shallow-submodules https://github.com/IntersectMBO/plutus-apps.git fi - pushd plutus-apps || exit 1 + cd plutus-apps || exit 1 git fetch origin main ;; @@ -24,7 +25,7 @@ case "${PLUTUS_APPS_REV:-""}" in git clone --recurse-submodules https://github.com/IntersectMBO/plutus-apps.git fi - pushd plutus-apps || exit 1 + cd plutus-apps || exit 1 git fetch ;; esac @@ -40,4 +41,5 @@ nix build --accept-flake-config .#create-script-context -o create-script-context PATH="$(readlink -m create-script-context-build/bin)":"$PATH" export PATH -pushd "$REPODIR" || exit 1 +cd "$_origpwd" || exit 1 +unset _origpwd