浏览代码

[F] Try to fix windows symbolic link

https://github.com/hykilpikonna/hyfetch/issues/16
Azalea (on HyDEV-Daisy) 2 年之前
父节点
当前提交
170e1148a9
共有 2 个文件被更改,包括 9 次插入3 次删除
  1. 7 1
      hyfetch/neofetch_util.py
  2. 2 2
      setup.py

+ 7 - 1
hyfetch/neofetch_util.py

@@ -141,7 +141,13 @@ def get_command_path() -> str:
 
 
     :return: Command path
     :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:
 def ensure_git_bash() -> Path:

+ 2 - 2
setup.py

@@ -35,10 +35,10 @@ setup(
     include_package_data=True,
     include_package_data=True,
     install_requires=[
     install_requires=[
         # Universal dependencies
         # Universal dependencies
-        'setuptools', 'typing_extensions'
+        'setuptools', 'typing_extensions',
         
         
         # Windows dependencies
         # Windows dependencies
-        'psutil ; platform_system=="Windows"'
+        'psutil ; platform_system=="Windows"',
     ],
     ],
     entry_points={
     entry_points={
         "console_scripts": [
         "console_scripts": [