diff --git a/.github/scripts/update-docs-link.sh b/.github/scripts/update-docs-link.sh index b559b2e2ec..014b6a646a 100755 --- a/.github/scripts/update-docs-link.sh +++ b/.github/scripts/update-docs-link.sh @@ -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 +)