From 8c5cf0c26d9aca8061873f993f7d98e6e61f0f38 Mon Sep 17 00:00:00 2001 From: Caner Date: Tue, 27 Jan 2026 15:40:09 +0300 Subject: [PATCH] Add build nosman scripts to build & copy nosman to root --- BuildNosman.bat | 24 ++++++++++++++++++++++++ BuildNosman.sh | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 BuildNosman.bat create mode 100644 BuildNosman.sh diff --git a/BuildNosman.bat b/BuildNosman.bat new file mode 100644 index 0000000..172cb59 --- /dev/null +++ b/BuildNosman.bat @@ -0,0 +1,24 @@ +@echo off +setlocal + +:: Configuration +set PROJECT_DIR=Toolchain\nosman +set OUTPUT_NAME=nodos.exe +set BIN_NAME=nosman.exe + +pushd %PROJECT_DIR% + +echo Building +cargo build --release +if %ERRORLEVEL% neq 0 ( + echo. + echo [ERROR] Build failed. Please check your Rust code. + popd + exit /b %ERRORLEVEL% +) + +popd +move /y "%PROJECT_DIR%\target\release\%BIN_NAME%" ".\%OUTPUT_NAME%" + +echo. +echo Success \ No newline at end of file diff --git a/BuildNosman.sh b/BuildNosman.sh new file mode 100644 index 0000000..347c6c3 --- /dev/null +++ b/BuildNosman.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +# Configuration +PROJECT_DIR="Toolchain/nosman" +OUTPUT_NAME="nodos" +BIN_NAME="nosman" + +# Navigate to the project directory +if ! cd "$PROJECT_DIR"; then + echo "[ERROR] Could not find directory $PROJECT_DIR" + exit 1 +fi + +echo "Building" +cargo build --release +if [ $? -ne 0 ]; then + echo "" + echo "[ERROR] Build failed. Please check your Rust code." + exit 1 +fi + +# Move back to the original root directory and move the file +cd - > /dev/null + +# Remove the old file first to prevent "same file" warnings/errors +if [ -f "./$OUTPUT_NAME" ]; then + rm -f "./$OUTPUT_NAME" +fi + +# Move the new binary +mv "$PROJECT_DIR/target/release/$BIN_NAME" "./$OUTPUT_NAME" + +# Ensure the new binary is executable +chmod +x "./$OUTPUT_NAME" + +echo "" +echo "Success" \ No newline at end of file