Skip to content

Commit

Permalink
fix: 💚 再次尝试修复CI编译
Browse files Browse the repository at this point in the history
📝`if cfg!(windows)`对`#[cfg(windows)]`无效:编译时仍会缺少符号
  • Loading branch information
ARCJ137442 committed Sep 14, 2024
1 parent 803cf5f commit bf400be
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 10 deletions.
9 changes: 6 additions & 3 deletions README.en-us.md → README.en.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
# BabelNAR.rs
# BabelNAR-CLI.rs

[简体中文](./README.md) | English
|[简体中文](README.md) | **English**|
|:-:|:-:|

🏗️The **English document** of the project is still under preparation. PR is welcome.

[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-%23FE5196?logo=conventionalcommits&logoColor=white)](https://conventionalcommits.org)

Implementation and application supports of the NAVM model
## Introduction

[**BabelNAR.rs**](https://github.com/ARCJ137442/BabelNAR.rs)'s Command Line Interface (CLI)

⚠️【2024-04-03 15:12:55】**This documentation is still in progress. For full and latest content, please refer to [the Simplified Chinese version](README.zh-cn.md).**
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
# BabelNAR-CLI.rs

简体中文 | [English](./README.en-us.md)
|**简体中文** | [English](README.en.md)|
|:-:|:-:|

🏗️项目的**英文文档**尚在筹建,有意者欢迎提交PR

[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-%23FE5196?logo=conventionalcommits&logoColor=white)](https://conventionalcommits.org)

该项目使用[语义化版本 2.0.0](https://semver.org/)进行版本号管理。

[**BabelNAR.rs**](https://github.com/ARCJ137442/NAVM.rs)的命令行接口(CLI)
## 简介

[**BabelNAR.rs**](https://github.com/ARCJ137442/BabelNAR.rs)的命令行接口(CLI)

- ✨从配置中快速启动、测试各类NARS实现
- 🎯一站式NARS**启动器**
Expand Down
20 changes: 15 additions & 5 deletions src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,8 @@ pub fn main_args(cwd: IoResult<PathBuf>, args: impl Iterator<Item = String>) ->
.inspect_err(|e| println_cli!([Warn] "无法获取当前工作目录:{e}"))
.ok();

// (Windows下)启用终端颜色
if cfg!(windows) {
let _ = colored::control::set_virtual_terminal(true)
.inspect_err(|_| eprintln_cli!([Error] "无法启动终端彩色显示。。"));
}
// 启用终端颜色(若可)
set_virtual_terminal();

// 解析命令行参数
let args = CliArgs::parse_from(args);
Expand Down Expand Up @@ -93,3 +90,16 @@ pub fn main_args(cwd: IoResult<PathBuf>, args: impl Iterator<Item = String>) ->
// 返回结果
result
}

/// 启动终端颜色(Windows下)
#[cfg(windows)]
fn set_virtual_terminal() {
let _ = colored::control::set_virtual_terminal(true)
.inspect_err(|_| eprintln_cli!([Error] "无法启动终端彩色显示。。"));
}

/// 启动终端颜色(非Windows)
#[cfg(not(windows))]
fn set_virtual_terminal() {
// * 🚩【2024-09-14 16:09:42】目前代码为空
}

0 comments on commit bf400be

Please sign in to comment.