mirror of
https://github.com/hykilpikonna/hyfetch.git
synced 2026-08-06 02:33:51 -05:00
[F] Fix ascii from file for neofetch (#505)
Some checks failed
Shellcheck / check (push) Has been cancelled
Some checks failed
Shellcheck / check (push) Has been cancelled
This commit is contained in:
parent
e64f7efca6
commit
1890bb8f03
|
|
@ -65,6 +65,7 @@ fn main() -> Result<()> {
|
|||
&dir.join("neofetch"),
|
||||
&dir.join("../../neofetch"),
|
||||
]).context("couldn't find neofetch")?;
|
||||
println!("cargo:rerun-if-changed={}", neofetch_src.display());
|
||||
fs::copy(&neofetch_src, o.join("neofetch"))?;
|
||||
|
||||
preset_codegen(&o.join("hyfetch/data/presets.json"), &o.join("presets.rs"))?;
|
||||
|
|
|
|||
5
neofetch
5
neofetch
|
|
@ -5556,8 +5556,11 @@ strip_escape_codes() {
|
|||
}
|
||||
|
||||
print_ascii() {
|
||||
local ascii_from_file="off"
|
||||
|
||||
if [[ -f "$image_source" && ! "$image_source" =~ (png|jpg|jpeg|jpe|svg|gif) ]]; then
|
||||
ascii_data="$(< "$image_source")"
|
||||
ascii_from_file="on"
|
||||
elif [[ "$image_source" == "ascii" || $image_source == auto ]]; then
|
||||
:
|
||||
else
|
||||
|
|
@ -5586,7 +5589,7 @@ print_ascii() {
|
|||
fi
|
||||
|
||||
# Fallback if file not found.
|
||||
((lines==1)) && {
|
||||
[[ "$ascii_from_file" != "on" ]] && ((lines==1)) && {
|
||||
lines=
|
||||
ascii_len=
|
||||
image_source=auto
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user