Skip to content

Commit

Permalink
Merge pull request conda-forge#158 from mrclary/post-link-fix
Browse files Browse the repository at this point in the history
Fix sed syntax and macOS bundle names with spaces
  • Loading branch information
ccordoba12 authored Jan 26, 2024
2 parents fc8e390 + f38cf3b commit 8f7bf64
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
8 changes: 4 additions & 4 deletions recipe/post-link.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/bin/bash
set -e

[[ $(sed --version 2>/dev/null) ]] && opts=("-i" "-e") || opts=("-i" "" "-e")
[[ $(sed --version 2>/dev/null) ]] && opts=("-i" "-E") || opts=("-i" "" "-E")
menu="${PREFIX}/Menu/spyder-menu.json"

if [[ -f "${PREFIX}/Menu/conda-based-app" ]]; then
# Installed in installer environment, abridge shortcut name
menu="${PREFIX}/Menu/spyder-menu.json"
sed ${opts[@]} "s/ \(\{\{ ENV_NAME \}\}\)//g" $menu
sed "${opts[@]}" "s/ \(\{\{ ENV_NAME \}\}\)//g" $menu
elif [[ -d "${PREFIX}/condabin" && -d "${PREFIX}/envs" ]]; then
# Installed in a base environment, use distribution name
sed ${opts[@]} "s/ENV_NAME/DISTRIBUTION_NAME/g" $menu
sed "${opts[@]}" "s/ENV_NAME/DISTRIBUTION_NAME/g" $menu
fi
5 changes: 3 additions & 2 deletions recipe/spyder-menu.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@
},
"linux": {
"Categories": [
"Graphics",
"Development",
"Science"
],
"command": ["{{ PREFIX }}/bin/spyder", "$@"],
"StartupWMClass": "Spyder"
},
"osx": {
"command": ["$(dirname $0)/python", "{{ PREFIX }}/bin/spyder", "$@"],
"precommand": "pushd \"$(dirname \"$0\")\" &>/dev/null",
"command": ["./python", "{{ PREFIX }}/bin/spyder", "$@"],
"link_in_bundle": {
"{{ PREFIX }}/bin/python": "{{ MENU_ITEM_LOCATION }}/Contents/MacOS/python"
},
Expand Down

0 comments on commit 8f7bf64

Please # to comment.