add tool.
This commit is contained in:
@@ -1,6 +1,41 @@
|
||||
#!/bin/bash
|
||||
|
||||
base_path=$(pwd)
|
||||
build_path=${base_path}/build
|
||||
libraries_root="/opt/Libraries"
|
||||
|
||||
if command -v cmake >/dev/null 2>&1; then
|
||||
cmake_exe=cmake
|
||||
else
|
||||
cmake_exe=/opt/Qt/Tools/CMake/bin/cmake
|
||||
fi
|
||||
|
||||
function cmake_scan() {
|
||||
echo "scanning the project..."
|
||||
if [ ! -d ${build_path} ]; then
|
||||
mkdir -p ${build_path}
|
||||
fi
|
||||
cd ${build_path}
|
||||
${cmake_exe} -G Ninja -S ${base_path} -B ${build_path} \
|
||||
-DCMAKE_BUILD_TYPE=Debug \
|
||||
-DMbedTLS_DIR=${libraries_root}/mbedtls-3.6.5/lib/cmake/MbedTLS \
|
||||
-Dnng_DIR=${libraries_root}/nng-1.11/lib/cmake/nng \
|
||||
-DBoost_DIR=${libraries_root}/boost_1_89_0/lib/cmake/Boost-1.89.0
|
||||
}
|
||||
|
||||
function build() {
|
||||
echo "building the project..."
|
||||
if [ ! -f "${build_path}/CMakeCache.txt" ]; then
|
||||
cmake_scan
|
||||
fi
|
||||
if [ $? -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
${cmake_exe} --build ${build_path} --target all
|
||||
if [ $? -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
function changelog(){
|
||||
current_tag=$(git describe --tags --abbrev=0)
|
||||
@@ -15,9 +50,12 @@ function main() {
|
||||
case $cmd in
|
||||
changelog)
|
||||
changelog
|
||||
;;
|
||||
build)
|
||||
build
|
||||
;;
|
||||
*)
|
||||
changelog
|
||||
build
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
9
resources/wsl2_ssh.ps1
Normal file
9
resources/wsl2_ssh.ps1
Normal file
@@ -0,0 +1,9 @@
|
||||
wsl -u root -e sh -c "service ssh start"
|
||||
|
||||
$wsl_ip = (wsl hostname -I).trim()
|
||||
netsh interface portproxy delete v4tov4 listenport=1022
|
||||
netsh interface portproxy add v4tov4 listenport=1022 connectport=1022 connectaddress=$wsl_ip
|
||||
|
||||
netsh interface portproxy delete v4tov4 listenport=2049
|
||||
netsh interface portproxy add v4tov4 listenport=2049 connectport=2049 connectaddress=$wsl_ip
|
||||
|
||||
Reference in New Issue
Block a user