[F] Fix #499: neowofetch not found
This commit is contained in:
@@ -5,6 +5,13 @@ import os
|
|||||||
from .py import run_py
|
from .py import run_py
|
||||||
from .rs import run_rust
|
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 __name__ == '__main__':
|
||||||
if os.environ.get('HYFETCH_PY', False):
|
if os.environ.get('HYFETCH_PY', False):
|
||||||
run_py()
|
run_py()
|
||||||
|
|||||||
@@ -248,19 +248,22 @@ def check_windows_cmd():
|
|||||||
# sys.exit(0)
|
# 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
|
Run neofetch command
|
||||||
"""
|
"""
|
||||||
|
if isinstance(args, str):
|
||||||
|
args = shlex.split(args)
|
||||||
|
|
||||||
if platform.system() != 'Windows':
|
if platform.system() != 'Windows':
|
||||||
bash = ['/usr/bin/env', 'bash'] if Path('/usr/bin/env').is_file() else [shutil.which('bash')]
|
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:
|
else:
|
||||||
cmd = get_command_path().replace("\\", "/").replace("C:/", "/c/")
|
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]
|
full_cmd = [str(c) for c in full_cmd]
|
||||||
if pipe:
|
if pipe:
|
||||||
|
|||||||
+2
-2
@@ -40,6 +40,7 @@ Homepage = "https://github.com/hykilpikonna/HyFetch"
|
|||||||
"hyfetch.v1" = "hyfetch.__main__:run_py"
|
"hyfetch.v1" = "hyfetch.__main__:run_py"
|
||||||
"hyfetch.rs" = "hyfetch.__main__:run_rust"
|
"hyfetch.rs" = "hyfetch.__main__:run_rust"
|
||||||
"hyfetch" = "hyfetch.__main__:run_rust"
|
"hyfetch" = "hyfetch.__main__:run_rust"
|
||||||
|
"neowofetch" = "hyfetch.__main__:run_neofetch"
|
||||||
|
|
||||||
[tool.hatch.version]
|
[tool.hatch.version]
|
||||||
source = "regex"
|
source = "regex"
|
||||||
@@ -49,5 +50,4 @@ regex = 'version = "(?P<version>.+?)"'
|
|||||||
[tool.hatch.build]
|
[tool.hatch.build]
|
||||||
exclude = ["/tools"]
|
exclude = ["/tools"]
|
||||||
|
|
||||||
[tool.hatch.build.targets.wheel.files]
|
|
||||||
"{py_scripts}/neowofetch" = "hyfetch/scripts/neowofetch"
|
|
||||||
|
|||||||
Reference in New Issue
Block a user