[F] Fix #499: neowofetch not found

This commit is contained in:
2026-04-20 01:43:50 -04:00
parent 7433df5d74
commit 7bfb750f63
3 changed files with 16 additions and 6 deletions
+7
View File
@@ -5,6 +5,13 @@ import os
from .py import run_py
from .rs import run_rust
def run_neofetch():
from .neofetch_util import run_neofetch_cmd
import sys
run_neofetch_cmd(sys.argv[1:])
if __name__ == '__main__':
if os.environ.get('HYFETCH_PY', False):
run_py()
+7 -4
View File
@@ -248,19 +248,22 @@ def check_windows_cmd():
# sys.exit(0)
def run_neofetch_cmd(args: str, pipe: bool = False) -> str | None:
def run_neofetch_cmd(args: str | list[str], pipe: bool = False) -> str | None:
"""
Run neofetch command
"""
if isinstance(args, str):
args = shlex.split(args)
if platform.system() != 'Windows':
bash = ['/usr/bin/env', 'bash'] if Path('/usr/bin/env').is_file() else [shutil.which('bash')]
full_cmd = [*bash, get_command_path(), *shlex.split(args)]
full_cmd = [*bash, get_command_path(), *args]
else:
cmd = get_command_path().replace("\\", "/").replace("C:/", "/c/")
args = args.replace('\\', '/').replace('C:/', '/c/')
args = [a.replace('\\', '/').replace('C:/', '/c/') for a in args]
full_cmd = [ensure_git_bash(), cmd, *shlex.split(args)]
full_cmd = [ensure_git_bash(), cmd, *args]
full_cmd = [str(c) for c in full_cmd]
if pipe:
+2 -2
View File
@@ -40,6 +40,7 @@ Homepage = "https://github.com/hykilpikonna/HyFetch"
"hyfetch.v1" = "hyfetch.__main__:run_py"
"hyfetch.rs" = "hyfetch.__main__:run_rust"
"hyfetch" = "hyfetch.__main__:run_rust"
"neowofetch" = "hyfetch.__main__:run_neofetch"
[tool.hatch.version]
source = "regex"
@@ -49,5 +50,4 @@ regex = 'version = "(?P<version>.+?)"'
[tool.hatch.build]
exclude = ["/tools"]
[tool.hatch.build.targets.wheel.files]
"{py_scripts}/neowofetch" = "hyfetch/scripts/neowofetch"