fix .sh files that broken in windows11

This commit is contained in:
fanlumaster
2025-01-02 06:24:06 +08:00
parent 12abe936bf
commit fee9fbd7f0
6 changed files with 172 additions and 172 deletions

36
scripts/lrun.sh Normal file → Executable file
View File

@ -1,18 +1,18 @@
content=$(<"./CMakeLists.txt")
exePath=""
while IFS= read -r line; do
if [[ $line == "set(MY_EXECUTABLE_NAME"* ]]; then
pattern="\"([^\"]+)\""
if [[ $line =~ $pattern ]]; then
contentInParentheses="${BASH_REMATCH[1]}"
result=($contentInParentheses)
exePath="./build/bin/${result[0]}"
fi
fi
done <<<"$content"
if [ -n "$exePath" ]; then
$exePath
else
echo "cannot find executable file path"
fi
content=$(<"./CMakeLists.txt")
exePath=""
while IFS= read -r line; do
if [[ $line == "set(MY_EXECUTABLE_NAME"* ]]; then
pattern="\"([^\"]+)\""
if [[ $line =~ $pattern ]]; then
contentInParentheses="${BASH_REMATCH[1]}"
result=($contentInParentheses)
exePath="./build/bin/${result[0]}"
fi
fi
done <<<"$content"
if [ -n "$exePath" ]; then
$exePath
else
echo "cannot find executable file path"
fi