From 170e1148a97b223d2391face2e3cf0832eaf769b Mon Sep 17 00:00:00 2001 From: "Azalea (on HyDEV-Daisy)" Date: Tue, 30 Aug 2022 19:04:25 -0400 Subject: [PATCH] [F] Try to fix windows symbolic link https://github.com/hykilpikonna/hyfetch/issues/16 --- hyfetch/neofetch_util.py | 8 +++++++- setup.py | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/hyfetch/neofetch_util.py b/hyfetch/neofetch_util.py index ea2431f2..51e57624 100644 --- a/hyfetch/neofetch_util.py +++ b/hyfetch/neofetch_util.py @@ -141,7 +141,13 @@ def get_command_path() -> str: :return: Command path """ - return pkg_resources.resource_filename(__name__, 'scripts/neowofetch') + cmd_path = pkg_resources.resource_filename(__name__, 'scripts/neowofetch') + + # Windows doesn't support symbolic links, but also I can't detect symbolic links... hard-code it here for now. + if platform.system() == 'Windows': + return str(Path(cmd_path).parent.parent / 'neofetch') + + return cmd_path def ensure_git_bash() -> Path: diff --git a/setup.py b/setup.py index c9a4e0e7..78095c89 100755 --- a/setup.py +++ b/setup.py @@ -35,10 +35,10 @@ setup( include_package_data=True, install_requires=[ # Universal dependencies - 'setuptools', 'typing_extensions' + 'setuptools', 'typing_extensions', # Windows dependencies - 'psutil ; platform_system=="Windows"' + 'psutil ; platform_system=="Windows"', ], entry_points={ "console_scripts": [