Skip to content

Commit

Permalink
Use sub-shells instead of pushd
Browse files Browse the repository at this point in the history
  • Loading branch information
carleeto committed Aug 11, 2023
1 parent 6b6f8e5 commit 4381c3c
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions .github/scripts/update-docs-link.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ fi

FILE=_typescript.mdx

pushd $CLONE_DIR
if [[ "$OSTYPE" == "darwin"* ]]; then
# On Mac OS, sed requires an empty string as an argument to -i to avoid creating a backup file
sed -i '' -E "s/[0-9]\\.[0-9]\\.[0-9](.* class=\"ts-immutable-sdk-ref-link\")/$VERSION\1/g;" $FILE
else
sed -i -E "s/[0-9]\\.[0-9]\\.[0-9](.* class=\"ts-immutable-sdk-ref-link\")/$VERSION\1/g;" $FILE
fi
popd
(
cd $CLONE_DIR;
if [[ "$OSTYPE" == "darwin"* ]]; then
# On Mac OS, sed requires an empty string as an argument to -i to avoid creating a backup file
sed -i '' -E "s/[0-9]\\.[0-9]\\.[0-9](.* class=\"ts-immutable-sdk-ref-link\")/$VERSION\1/g;" $FILE
else
sed -i -E "s/[0-9]\\.[0-9]\\.[0-9](.* class=\"ts-immutable-sdk-ref-link\")/$VERSION\1/g;" $FILE
fi
)

0 comments on commit 4381c3c

Please sign in to comment.