#!/bin/bash clear # 读取用户输入 echo "请输入操作类型" echo "【开发/构建/0/1】:" read operation clear # 根据用户输入执行相应操作 case $operation in "0") echo "开发期运行" cargo build ;; "1") echo "构建二进制" cargo build --release ;; *) cargo build ;; esac # 添加文件后需要在终端给脚本文件执行权限 # chmod 777 start