mirror of
https://github.com/fanlumaster/googlepinyinime-rev.git
synced 2025-07-18 08:57:54 +08:00
fix .sh files that broken in windows11
This commit is contained in:
46
command/scripts/lcompile.sh
Normal file → Executable file
46
command/scripts/lcompile.sh
Normal file → Executable file
@ -1,23 +1,23 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
currentDirectory=$(pwd)
|
currentDirectory=$(pwd)
|
||||||
cmakeListsPath="${currentDirectory}/CMakeLists.txt"
|
cmakeListsPath="${currentDirectory}/CMakeLists.txt"
|
||||||
|
|
||||||
if [ ! -f "$cmakeListsPath" ]; then
|
if [ ! -f "$cmakeListsPath" ]; then
|
||||||
echo "No CMakeLists.txt in current directory, please check."
|
echo "No CMakeLists.txt in current directory, please check."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Start generating and compiling..."
|
echo "Start generating and compiling..."
|
||||||
|
|
||||||
buildFolderPath="./build"
|
buildFolderPath="./build"
|
||||||
|
|
||||||
if [ ! -d "$buildFolderPath" ]; then
|
if [ ! -d "$buildFolderPath" ]; then
|
||||||
mkdir -p "$buildFolderPath"
|
mkdir -p "$buildFolderPath"
|
||||||
echo "build folder created."
|
echo "build folder created."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cmake -G "Unix Makefiles" -D CMAKE_CXX_COMPILER=/usr/bin/g++ -S . -B ./build/
|
cmake -G "Unix Makefiles" -D CMAKE_CXX_COMPILER=/usr/bin/g++ -S . -B ./build/
|
||||||
|
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
cmake --build ./build/ --config DEBUG
|
cmake --build ./build/ --config DEBUG
|
||||||
fi
|
fi
|
||||||
|
90
command/scripts/llaunch.sh
Normal file → Executable file
90
command/scripts/llaunch.sh
Normal file → Executable file
@ -1,45 +1,45 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
currentDirectory=$(pwd)
|
currentDirectory=$(pwd)
|
||||||
cmakeListsPath="${currentDirectory}/CMakeLists.txt"
|
cmakeListsPath="${currentDirectory}/CMakeLists.txt"
|
||||||
|
|
||||||
if [ ! -f "$cmakeListsPath" ]; then
|
if [ ! -f "$cmakeListsPath" ]; then
|
||||||
echo "No CMakeLists.txt in current directory, please check."
|
echo "No CMakeLists.txt in current directory, please check."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Start generating and compiling..."
|
echo "Start generating and compiling..."
|
||||||
|
|
||||||
buildFolderPath="./build"
|
buildFolderPath="./build"
|
||||||
|
|
||||||
if [ ! -d "$buildFolderPath" ]; then
|
if [ ! -d "$buildFolderPath" ]; then
|
||||||
mkdir -p "$buildFolderPath"
|
mkdir -p "$buildFolderPath"
|
||||||
echo "build folder created."
|
echo "build folder created."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cmake -G "Unix Makefiles" -D CMAKE_CXX_COMPILER=/usr/bin/g++ -S . -B ./build/
|
cmake -G "Unix Makefiles" -D CMAKE_CXX_COMPILER=/usr/bin/g++ -S . -B ./build/
|
||||||
|
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
cmake --build ./build/ --config DEBUG
|
cmake --build ./build/ --config DEBUG
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
content=$(<"./CMakeLists.txt")
|
content=$(<"./CMakeLists.txt")
|
||||||
exePath=""
|
exePath=""
|
||||||
while IFS= read -r line; do
|
while IFS= read -r line; do
|
||||||
if [[ $line == "set(MY_EXECUTABLE_NAME"* ]]; then
|
if [[ $line == "set(MY_EXECUTABLE_NAME"* ]]; then
|
||||||
pattern="\"([^\"]+)\""
|
pattern="\"([^\"]+)\""
|
||||||
if [[ $line =~ $pattern ]]; then
|
if [[ $line =~ $pattern ]]; then
|
||||||
contentInParentheses="${BASH_REMATCH[1]}"
|
contentInParentheses="${BASH_REMATCH[1]}"
|
||||||
result=($contentInParentheses)
|
result=($contentInParentheses)
|
||||||
exePath="./build/bin/${result[0]}"
|
exePath="./build/bin/${result[0]}"
|
||||||
echo "start running as follows..."
|
echo "start running as follows..."
|
||||||
echo "=================================================="
|
echo "=================================================="
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done <<<"$content"
|
done <<<"$content"
|
||||||
# execute the binary file
|
# execute the binary file
|
||||||
if [ -n "$exePath" ]; then
|
if [ -n "$exePath" ]; then
|
||||||
$exePath
|
$exePath
|
||||||
else
|
else
|
||||||
echo "cannot find executable file path"
|
echo "cannot find executable file path"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
36
command/scripts/lrun.sh
Normal file → Executable file
36
command/scripts/lrun.sh
Normal file → Executable file
@ -1,18 +1,18 @@
|
|||||||
content=$(<"./CMakeLists.txt")
|
content=$(<"./CMakeLists.txt")
|
||||||
exePath=""
|
exePath=""
|
||||||
while IFS= read -r line; do
|
while IFS= read -r line; do
|
||||||
if [[ $line == "set(MY_EXECUTABLE_NAME"* ]]; then
|
if [[ $line == "set(MY_EXECUTABLE_NAME"* ]]; then
|
||||||
pattern="\"([^\"]+)\""
|
pattern="\"([^\"]+)\""
|
||||||
if [[ $line =~ $pattern ]]; then
|
if [[ $line =~ $pattern ]]; then
|
||||||
contentInParentheses="${BASH_REMATCH[1]}"
|
contentInParentheses="${BASH_REMATCH[1]}"
|
||||||
result=($contentInParentheses)
|
result=($contentInParentheses)
|
||||||
exePath="./build/bin/${result[0]}"
|
exePath="./build/bin/${result[0]}"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done <<<"$content"
|
done <<<"$content"
|
||||||
|
|
||||||
if [ -n "$exePath" ]; then
|
if [ -n "$exePath" ]; then
|
||||||
$exePath
|
$exePath
|
||||||
else
|
else
|
||||||
echo "cannot find executable file path"
|
echo "cannot find executable file path"
|
||||||
fi
|
fi
|
||||||
|
46
scripts/lcompile.sh
Normal file → Executable file
46
scripts/lcompile.sh
Normal file → Executable file
@ -1,23 +1,23 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
currentDirectory=$(pwd)
|
currentDirectory=$(pwd)
|
||||||
cmakeListsPath="${currentDirectory}/CMakeLists.txt"
|
cmakeListsPath="${currentDirectory}/CMakeLists.txt"
|
||||||
|
|
||||||
if [ ! -f "$cmakeListsPath" ]; then
|
if [ ! -f "$cmakeListsPath" ]; then
|
||||||
echo "No CMakeLists.txt in current directory, please check."
|
echo "No CMakeLists.txt in current directory, please check."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Start generating and compiling..."
|
echo "Start generating and compiling..."
|
||||||
|
|
||||||
buildFolderPath="./build"
|
buildFolderPath="./build"
|
||||||
|
|
||||||
if [ ! -d "$buildFolderPath" ]; then
|
if [ ! -d "$buildFolderPath" ]; then
|
||||||
mkdir -p "$buildFolderPath"
|
mkdir -p "$buildFolderPath"
|
||||||
echo "build folder created."
|
echo "build folder created."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cmake -G "Unix Makefiles" -D CMAKE_CXX_COMPILER=/usr/bin/g++ -S . -B ./build/
|
cmake -G "Unix Makefiles" -D CMAKE_CXX_COMPILER=/usr/bin/g++ -S . -B ./build/
|
||||||
|
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
cmake --build ./build/ --config DEBUG
|
cmake --build ./build/ --config DEBUG
|
||||||
fi
|
fi
|
||||||
|
90
scripts/llaunch.sh
Normal file → Executable file
90
scripts/llaunch.sh
Normal file → Executable file
@ -1,45 +1,45 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
currentDirectory=$(pwd)
|
currentDirectory=$(pwd)
|
||||||
cmakeListsPath="${currentDirectory}/CMakeLists.txt"
|
cmakeListsPath="${currentDirectory}/CMakeLists.txt"
|
||||||
|
|
||||||
if [ ! -f "$cmakeListsPath" ]; then
|
if [ ! -f "$cmakeListsPath" ]; then
|
||||||
echo "No CMakeLists.txt in current directory, please check."
|
echo "No CMakeLists.txt in current directory, please check."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Start generating and compiling..."
|
echo "Start generating and compiling..."
|
||||||
|
|
||||||
buildFolderPath="./build"
|
buildFolderPath="./build"
|
||||||
|
|
||||||
if [ ! -d "$buildFolderPath" ]; then
|
if [ ! -d "$buildFolderPath" ]; then
|
||||||
mkdir -p "$buildFolderPath"
|
mkdir -p "$buildFolderPath"
|
||||||
echo "build folder created."
|
echo "build folder created."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cmake -G "Unix Makefiles" -D CMAKE_CXX_COMPILER=/usr/bin/g++ -S . -B ./build/
|
cmake -G "Unix Makefiles" -D CMAKE_CXX_COMPILER=/usr/bin/g++ -S . -B ./build/
|
||||||
|
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
cmake --build ./build/ --config DEBUG
|
cmake --build ./build/ --config DEBUG
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
content=$(<"./CMakeLists.txt")
|
content=$(<"./CMakeLists.txt")
|
||||||
exePath=""
|
exePath=""
|
||||||
while IFS= read -r line; do
|
while IFS= read -r line; do
|
||||||
if [[ $line == "set(MY_EXECUTABLE_NAME"* ]]; then
|
if [[ $line == "set(MY_EXECUTABLE_NAME"* ]]; then
|
||||||
pattern="\"([^\"]+)\""
|
pattern="\"([^\"]+)\""
|
||||||
if [[ $line =~ $pattern ]]; then
|
if [[ $line =~ $pattern ]]; then
|
||||||
contentInParentheses="${BASH_REMATCH[1]}"
|
contentInParentheses="${BASH_REMATCH[1]}"
|
||||||
result=($contentInParentheses)
|
result=($contentInParentheses)
|
||||||
exePath="./build/bin/${result[0]}"
|
exePath="./build/bin/${result[0]}"
|
||||||
echo "start running as follows..."
|
echo "start running as follows..."
|
||||||
echo "=================================================="
|
echo "=================================================="
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done <<<"$content"
|
done <<<"$content"
|
||||||
# execute the binary file
|
# execute the binary file
|
||||||
if [ -n "$exePath" ]; then
|
if [ -n "$exePath" ]; then
|
||||||
$exePath
|
$exePath
|
||||||
else
|
else
|
||||||
echo "cannot find executable file path"
|
echo "cannot find executable file path"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
36
scripts/lrun.sh
Normal file → Executable file
36
scripts/lrun.sh
Normal file → Executable file
@ -1,18 +1,18 @@
|
|||||||
content=$(<"./CMakeLists.txt")
|
content=$(<"./CMakeLists.txt")
|
||||||
exePath=""
|
exePath=""
|
||||||
while IFS= read -r line; do
|
while IFS= read -r line; do
|
||||||
if [[ $line == "set(MY_EXECUTABLE_NAME"* ]]; then
|
if [[ $line == "set(MY_EXECUTABLE_NAME"* ]]; then
|
||||||
pattern="\"([^\"]+)\""
|
pattern="\"([^\"]+)\""
|
||||||
if [[ $line =~ $pattern ]]; then
|
if [[ $line =~ $pattern ]]; then
|
||||||
contentInParentheses="${BASH_REMATCH[1]}"
|
contentInParentheses="${BASH_REMATCH[1]}"
|
||||||
result=($contentInParentheses)
|
result=($contentInParentheses)
|
||||||
exePath="./build/bin/${result[0]}"
|
exePath="./build/bin/${result[0]}"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done <<<"$content"
|
done <<<"$content"
|
||||||
|
|
||||||
if [ -n "$exePath" ]; then
|
if [ -n "$exePath" ]; then
|
||||||
$exePath
|
$exePath
|
||||||
else
|
else
|
||||||
echo "cannot find executable file path"
|
echo "cannot find executable file path"
|
||||||
fi
|
fi
|
||||||
|
Reference in New Issue
Block a user