conda-forge / git-feedstock

A conda-smithy repository for git.
BSD 3-Clause "New" or "Revised" License
1 stars 32 forks source link

Windows shortcut doesn't check conda distribution #123

Open FaustinCarter opened 2 years ago

FaustinCarter commented 2 years ago

Solution to issue cannot be found in the documentation.

Issue

When installing the git package on a Windows machine, a Windows shortcut is added (using menuinst). This shortcut is hardcoded to install to a folder called "Anaconda${PY_VER} ${PLATFORM}". This is really annoying when a user is using miniconda, or any custom distribution (i.e. some company made their own distribution using constructor). The menuinst package provides a $DISTRIBUTION_NAME variable, which can be used instead. This will neatly group the git windows shortcut into the same Start Menu folder as the rest of the shortcuts created in that distribution.

The proposed change is to update the menu-windows.json file as:

{
-    "menu_name": "Anaconda${PY_VER} ${PLATFORM}",
+    "menu_name": "${DISTRIBUTION_NAME}",
    "menu_items":
    [
    {
        "name": "Git Bash",
        "script": "${PREFIX}/Library/bin/bash.exe",
        "scriptarguments": ["--login", "-i", "--"],
        "workdir": "${PERSONALDIR}",
        "icon": "${MENU_DIR}/git-for-windows.ico"
    }
    ]
}

As an example of a feedstock that uses this, see spyder

Installed packages

n/a

Environment info

n/a
ocefpaf commented 2 years ago

Do you want to send a PR for this? I don't understand the first thing about Windows and menus but it sounds like a good solution.