Skip to content

Commit 3f3be2d

Browse files
authored
Merge pull request #2819 from IntersectMBO/imp_source_scripts
refactor(github): replace pushd/popd with cd
2 parents a8e1850 + 3f35d5b commit 3f3be2d

File tree

3 files changed

+20
-12
lines changed

3 files changed

+20
-12
lines changed

.github/source_cardano_cli.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/bin/bash
22

3-
pushd "$WORKDIR" || exit 1
3+
_origpwd="$PWD"
4+
cd "$WORKDIR" || exit 1
45

56
case "${CARDANO_CLI_REV:-""}" in
67
"" )
@@ -15,7 +16,7 @@ case "${CARDANO_CLI_REV:-""}" in
1516
git clone --depth 1 https://github.com/IntersectMBO/cardano-cli.git
1617
fi
1718

18-
pushd cardano-cli || exit 1
19+
cd cardano-cli || exit 1
1920
git fetch origin main
2021
;;
2122

@@ -24,7 +25,7 @@ case "${CARDANO_CLI_REV:-""}" in
2425
git clone https://github.com/IntersectMBO/cardano-cli.git
2526
fi
2627

27-
pushd cardano-cli || exit 1
28+
cd cardano-cli || exit 1
2829
git fetch
2930
;;
3031
esac
@@ -36,4 +37,5 @@ git rev-parse HEAD
3637
nix build --accept-flake-config .#cardano-cli -o cardano-cli-build || exit 1
3738
[ -e cardano-cli-build/bin/cardano-cli ] || exit 1
3839

39-
pushd "$REPODIR" || exit 1
40+
cd "$_origpwd" || exit 1
41+
unset _origpwd

.github/source_dbsync.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ TEST_THREADS="${TEST_THREADS:-15}"
44
CLUSTERS_COUNT="${CLUSTERS_COUNT:-4}"
55
export TEST_THREADS CLUSTERS_COUNT
66

7-
pushd "$WORKDIR" || exit 1
7+
_origpwd="$PWD"
8+
cd "$WORKDIR" || exit 1
89

910
stop_postgres() {
1011
echo "Stopping postgres"
@@ -57,7 +58,7 @@ case "${DBSYNC_REV:-""}" in
5758
git clone --depth 1 https://github.com/IntersectMBO/cardano-db-sync.git
5859
fi
5960

60-
pushd cardano-db-sync || exit 1
61+
cd cardano-db-sync || exit 1
6162
git fetch origin master
6263
;;
6364

@@ -66,7 +67,7 @@ case "${DBSYNC_REV:-""}" in
6667
git clone https://github.com/IntersectMBO/cardano-db-sync.git
6768
fi
6869

69-
pushd cardano-db-sync || exit 1
70+
cd cardano-db-sync || exit 1
7071
git fetch
7172
;;
7273
esac
@@ -112,7 +113,7 @@ fi
112113
[ -e db-sync-node/bin/cardano-db-sync ] || exit 1
113114
export DBSYNC_REPO="$PWD"
114115

115-
pushd "$REPODIR" || exit 1
116+
cd "$REPODIR" || exit 1
116117

117118
# set postgres env variables
118119
export PGHOST=localhost
@@ -121,3 +122,6 @@ export PGPORT=5432
121122

122123
# start and setup postgres
123124
./scripts/postgres-start.sh "$WORKDIR/postgres" -k
125+
126+
cd "$_origpwd" || exit 1
127+
unset _origpwd

.github/source_plutus_apps.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/bin/bash
22

3-
pushd "$WORKDIR" || exit 1
3+
_origpwd="$PWD"
4+
cd "$WORKDIR" || exit 1
45

56
case "${PLUTUS_APPS_REV:-""}" in
67
"" )
@@ -15,7 +16,7 @@ case "${PLUTUS_APPS_REV:-""}" in
1516
git clone --depth 1 --recurse-submodules --shallow-submodules https://github.com/IntersectMBO/plutus-apps.git
1617
fi
1718

18-
pushd plutus-apps || exit 1
19+
cd plutus-apps || exit 1
1920
git fetch origin main
2021
;;
2122

@@ -24,7 +25,7 @@ case "${PLUTUS_APPS_REV:-""}" in
2425
git clone --recurse-submodules https://github.com/IntersectMBO/plutus-apps.git
2526
fi
2627

27-
pushd plutus-apps || exit 1
28+
cd plutus-apps || exit 1
2829
git fetch
2930
;;
3031
esac
@@ -40,4 +41,5 @@ nix build --accept-flake-config .#create-script-context -o create-script-context
4041
PATH="$(readlink -m create-script-context-build/bin)":"$PATH"
4142
export PATH
4243

43-
pushd "$REPODIR" || exit 1
44+
cd "$_origpwd" || exit 1
45+
unset _origpwd

0 commit comments

Comments
 (0)