Skip to content

Commit e754cf0

Browse files
committed
refactor: replace cd with pushd/popd
Signed-off-by: ZHANG Yuntian <[email protected]>
1 parent 94d9721 commit e754cf0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/usr/lib/rsetup/cli/steam.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,18 +65,20 @@ EOF
6565
mkdir "${user_home}/wine/lib/"
6666
# cp libwine.so ${user_home}/wine/lib/
6767
# cp libwine.so.1 ${user_home}/wine/lib/
68-
cd "${user_home}/wine/" || exit
68+
pushd "${user_home}/wine/" || return 1
6969
latest_version="$(basename "$(curl -ILs -o /dev/null -w "%{url_effective}" https://github.com/Kron4ek/Wine-Builds/releases/latest)")"
7070
curl -Ls "https://github.com/Kron4ek/Wine-Builds/releases/download/$latest_version/wine-$latest_version-x86.tar.xz" > "wine-latest-x86.tar.xz"
7171
xz -d wine-latest-x86.tar.xz
7272
tar -xf wine-latest-x86.tar
73-
cd "wine-$latest_version-x86/" || exit
73+
popd || return 1
74+
pushd "${user_home}/wine/wine-$latest_version-x86/" || return 1
7475
cp -R ./* "${user_home}/wine"
7576
# ln -s "${user_home}/wine/bin/wine" /usr/local/bin/wine
7677
# ln -s "${user_home}/wine/bin/winecfg" /usr/local/bin/winecfg
7778
# ln -s "${user_home}/wine/bin/wineserver" /usr/local/bin/wineserver
7879
# #try to chown using either sudo_user or pkexec_uid
7980
chown -R "${SUDO_USER:-${PKEXEC_UID}}" "${user_home}/wine"
81+
popd || return 1
8082
echo "Run wine winecfg to let wine configure itself"
8183
}
8284

0 commit comments

Comments
 (0)