From 8b2517b9b183999567df6e6a42f921b96f6572b1 Mon Sep 17 00:00:00 2001 From: gaofei Date: Fri, 25 Apr 2025 10:06:58 +0800 Subject: [PATCH] Add win profile --- profiles/win/profile | 64 ++++++++++++++++++++++++++++++++++++++++++++ scripts/connect | 2 +- 2 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 profiles/win/profile diff --git a/profiles/win/profile b/profiles/win/profile new file mode 100644 index 0000000..b7a39d1 --- /dev/null +++ b/profiles/win/profile @@ -0,0 +1,64 @@ +alias l='ls -lhF' +alias la='ls -AlhF' +alias ll=l +alias open=explorer + +export LC_ALL=zh_CN.utf-8 +export http_proxyserver=http://127.0.0.1:10809 + +function set-proxy() { + if [[ $1 == "on" ]]; then + export HTTP_PROXY=$http_proxyserver + export HTTPS_PROXY=$http_proxyserver + elif [[ $1 == "off" ]]; then + unset HTTP_PROXY HTTPS_PROXY + fi + + echo + echo "HTTP_PROXY=$HTTP_PROXY" + echo "HTTPS_PROXY=$HTTPS_PROXY" + echo +} + +function c3_build() { + # check if augustus or julius build folder + + if [[ $PWD =~ "augustus" || $PWD =~ "julius" ]]; then + # 判断 basename 是否为 build + if [ "$(basename "$PWD")" = "build" ]; then + echo "当前目录: $PWD" + else + echo "【错误】进入 'augustus' 或者 'julius' 的 'build' 目录" + return 1 + fi + else + echo "【错误】进入 'augustus' 或者 'julius' 的 'build' 目录" + return 1 + fi + + + cmd=$1 + MINGW32_MAKE_PATH="/D/App/w64devkit/bin/mingw32-make.exe" + if [[ -z $cmd || $cmd == "build" ]]; then + if [[ ! -f "Makefile" ]]; then + cmake .. -G "MinGW Makefiles" + fi + $MINGW32_MAKE_PATH -j$(nproc) + + rm -rf assets maps + echo + echo " - Updating assets ..." && cp -r ../res/assets . + echo " - Updating maps ..." && cp -r ../res/maps . + echo " - Updating libs ..." && cp ../ext/SDL2/SDL2-2.32.4/x86_64-w64-mingw32/bin/SDL2.dll . && cp ../ext/SDL2/SDL2_mixer-2.8.1/x86_64-w64-mingw32/bin/SDL2_mixer.dll . + elif [[ $cmd == "clean" ]]; then + echo "开始清理..." + echo " - Deleting CMakeCache.txt ..." && rm -rf CMakeCache.txt + echo " - Deleting CMakeFiles ..." && rm -rf CMakeFiles + echo " - Deleting Makefile ..." && rm -f Makefile + echo " - Deleting cmake_install.cmake ..." && rm -f cmake_install.cmake + echo " - Deleting augustus.* ..." && rm -f augustus.* + echo " - Deleting res ..." && rm -rf assets maps + echo " - Deleting libs ..." && rm -rf SDL2* + echo " - Deleting Logs ..." && rm -rf *log*.txt + fi +} \ No newline at end of file diff --git a/scripts/connect b/scripts/connect index a24e185..aeecdf9 100755 --- a/scripts/connect +++ b/scripts/connect @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/bash GREEN='\033[0;32m' RED='\033[0;31m'