Compare commits

...

3 Commits

Author SHA1 Message Date
Alex
73927658d7
Merge baa5973128 into bcdcf70348 2025-04-30 22:15:37 +09:00
Arthur Sonzogni
bcdcf70348
Fix Bazel Central Repository Workflow (#1038)
Some checks are pending
Build / Bazel, ${{ matrix.compiler }}, ${{ matrix.os }} (cl, windows-latest) (push) Waiting to run
Build / Bazel, ${{ matrix.compiler }}, ${{ matrix.os }} (gcc, macos-latest) (push) Waiting to run
Build / Bazel, ${{ matrix.compiler }}, ${{ matrix.os }} (gcc, ubuntu-latest) (push) Waiting to run
Build / Bazel, ${{ matrix.compiler }}, ${{ matrix.os }} (llvm, macos-latest) (push) Waiting to run
Build / Bazel, ${{ matrix.compiler }}, ${{ matrix.os }} (llvm, ubuntu-latest) (push) Waiting to run
Build / CMake, ${{ matrix.compiler }}, ${{ matrix.os }} (cl, Windows MSVC, windows-latest) (push) Waiting to run
Build / CMake, ${{ matrix.compiler }}, ${{ matrix.os }} (gcc, Linux GCC, ubuntu-latest) (push) Waiting to run
Build / CMake, ${{ matrix.compiler }}, ${{ matrix.os }} (llvm, llvm-cov gcov, Linux Clang, ubuntu-latest) (push) Waiting to run
Build / CMake, ${{ matrix.compiler }}, ${{ matrix.os }} (llvm, llvm-cov gcov, MacOS clang, macos-latest) (push) Waiting to run
Build / Create release (push) Blocked by required conditions
Build / Build packages (build/ftxui*Darwin*, macos-latest) (push) Blocked by required conditions
Build / Build packages (build/ftxui*Linux*, ubuntu-latest) (push) Blocked by required conditions
Build / Build packages (build/ftxui*Win64*, windows-latest) (push) Blocked by required conditions
Build / Build source package (push) Blocked by required conditions
Build / documentation (push) Waiting to run
2025-04-30 12:04:32 +02:00
alexv-ds
baa5973128
msvc getenv deprecation warn fix 2024-07-18 18:34:34 +03:00
7 changed files with 25 additions and 19 deletions

View File

@ -231,7 +231,7 @@ jobs:
- name: "Create source package"
run: >
git archive --format=tar.gz --prefix=ftxui/ -o source.tar.gz HEAD
git archive --format=tar.gz -o source.tar.gz HEAD
- name: "Upload source package"
uses: shogo82148/actions-upload-release-asset@v1

View File

@ -1,11 +1,4 @@
on:
# On new releases:
workflow_call:
inputs:
tag_name:
required: true
type: string
# On manual trigger:
workflow_dispatch:
inputs:

View File

@ -4,7 +4,7 @@ Changelog
Future release
------------
6.1.0 (2025-04-29)
6.1.1 (2025-04-30)
-----------------
### Build
@ -15,7 +15,7 @@ Future release
**MODULE.bazel**
```bazel
bazel_dep(name = "ftxui", version = "6.1.0")
bazel_dep(name = "ftxui", version = "6.1.1")
```
**BUILD.bazel**

View File

@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.12)
project(ftxui
LANGUAGES CXX
VERSION 6.1.0
VERSION 6.1.1
DESCRIPTION "C++ Functional Terminal User Interface."
)

View File

@ -3,7 +3,7 @@
# the LICENSE file.
# FTXUI Module.
module(name = "ftxui", version = "6.1.0")
module(name = "ftxui", version = "6.1.1")
# Build deps.
bazel_dep(name = "rules_cc", version = "0.1.1")

View File

@ -372,7 +372,7 @@ include(FetchContent)
FetchContent_Declare(ftxui
GIT_REPOSITORY https://github.com/ArthurSonzogni/ftxui
GIT_TAG v6.1.0
GIT_TAG v6.1.1
)
FetchContent_GetProperties(ftxui)

View File

@ -48,25 +48,38 @@ Dimensions& FallbackSize() {
return g_fallback_size;
}
const char* Safe(const char* c) {
return (c != nullptr) ? c : "";
}
bool Contains(const std::string& s, const char* key) {
return s.find(key) != std::string::npos;
}
// https://github.com/gabime/spdlog/blob/885b5473e291833b148eeac3b7ce227e582cd88b/include/spdlog/details/os-inl.h#L566
std::string getenv_safe(const char *field) {
#if defined(_MSC_VER)
#if defined(__cplusplus_winrt)
return std::string{}; // not supported under uwp
#else
size_t len = 0;
char buf[1024];
bool ok = ::getenv_s(&len, buf, sizeof(buf), field) == 0;
return ok ? buf : std::string{};
#endif
#else // revert to getenv
char *buf = ::getenv(field); // NOLINT(*-mt-unsafe)
return buf ? buf : std::string{};
#endif
}
Terminal::Color ComputeColorSupport() {
#if defined(__EMSCRIPTEN__)
return Terminal::Color::TrueColor;
#endif
std::string COLORTERM = Safe(std::getenv("COLORTERM")); // NOLINT
std::string COLORTERM = getenv_safe("COLORTERM");
if (Contains(COLORTERM, "24bit") || Contains(COLORTERM, "truecolor")) {
return Terminal::Color::TrueColor;
}
std::string TERM = Safe(std::getenv("TERM")); // NOLINT
std::string TERM = getenv_safe("TERM");
if (Contains(COLORTERM, "256") || Contains(TERM, "256")) {
return Terminal::Color::Palette256;
}