mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
Help: fix json text loading
This commit is contained in:
+2
-2
@@ -206,7 +206,7 @@ endif()
|
||||
#############
|
||||
|
||||
function(fastfetch_encode_c_string STR OUTVAR)
|
||||
string(REGEX REPLACE "\n$" "" TEMP "${STR}") # Remove trailing newline
|
||||
string(REGEX REPLACE "\n$" "" TEMP "${STR}") # Remove trailing newline
|
||||
string(REPLACE "\\" "\\\\" TEMP "${TEMP}") # Escape backslashes
|
||||
string(REPLACE "\n" "\\n" TEMP "${TEMP}") # Replace newlines with \n
|
||||
string(REPLACE "\"" "\\\"" TEMP "${TEMP}") # Replace quotes with \"
|
||||
@@ -222,7 +222,7 @@ endfunction(fastfetch_load_text)
|
||||
find_package(Python)
|
||||
if(Python_FOUND)
|
||||
# Minify JSON string. `io.open(0,encoding='utf-8')` is needed to avoid encoding issues on Windows
|
||||
execute_process(COMMAND ${Python_EXECUTABLE} -c "import io,json,sys;json.dump(json.load(io.open(0,encoding='utf-8')),sys.stdout,separators=(',', ':'),ensure_ascii=False)"
|
||||
execute_process(COMMAND ${Python_EXECUTABLE} -c "import json,sys;json.dump(json.load(sys.stdin),sys.stdout,separators=(',',':'))"
|
||||
INPUT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/src/data/help.json"
|
||||
OUTPUT_VARIABLE DATATEXT_JSON_HELP)
|
||||
else()
|
||||
|
||||
+7
-7
@@ -548,7 +548,7 @@
|
||||
"desc": "Set the character to use in elapsed part of percentage bars",
|
||||
"arg": {
|
||||
"type": "str",
|
||||
"default": "■"
|
||||
"default": "\u25a0"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -1290,12 +1290,12 @@
|
||||
"arg": {
|
||||
"type": "enum",
|
||||
"enum": {
|
||||
"block": "███",
|
||||
"circle": "●",
|
||||
"diamond": "◆",
|
||||
"triangle": "▲",
|
||||
"square": "■",
|
||||
"star": "★"
|
||||
"block": "\u2588\u2588\u2588",
|
||||
"circle": "\u25cf",
|
||||
"diamond": "\u25c6",
|
||||
"triangle": "\u25b2",
|
||||
"square": "\u25a0",
|
||||
"star": "\u2605"
|
||||
},
|
||||
"default": "block"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user