Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions pixi-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ safe_expose_remove() {
environment=$1
executable=$2
if [ -d ${PIXI_HOME}/envs/${environment} ]; then
exposed_exes=$(pixi global list --environment ${environment} | tail -n 3 | head -n 1 | tr ',' '\n')
exposed_exes=$(pixi global list --json --environment ${environment} | jq '.[].exposed.[].exposed_name' | tr -d '"')
if [[ " ${exposed_exes[*]} " =~ [[:space:]]${executable}[[:space:]] ]]; then
pixi global expose remove ${executable}
fi
Expand Down Expand Up @@ -44,7 +44,7 @@ inject_packages() {
if [ ! -d ${PIXI_HOME}/envs/${environment} ]; then
missing_pkgs=$(cat ${package_list})
else
missing_pkgs=$(comm -13 <(pixi global list --environment ${environment} | cut -f 1 -d ' ' | head -n -6 | tail -n +3 | sort -u) <(sort -u ${package_list}))
missing_pkgs=$(comm -13 <(pixi global list --json --environment ${environment} | jq '.[].dependencies.[].name' | tr -d '"') <(sort -u ${package_list}))
fi

if (( $(echo ${missing_pkgs} | wc -w) > 0 )); then
Expand Down Expand Up @@ -149,13 +149,13 @@ else

install_global_packages <(extract_section "${_full_file}" "global")

if [[ "$OSTYPE" == "linux-gnu"* ]]; then
if [[ "$OSTYPE" =~ .*linux.* ]]; then
safe_expose_remove util-linux kill
fi

install_global_packages <(echo "coreutils")

if [[ "$OSTYPE" == "linux-gnu"* ]]; then
if [[ "$OSTYPE" =~ .*linux.* ]]; then
safe_expose_remove coreutils kill
safe_expose_remove coreutils uptime
install_global_packages <(extract_section "${_full_file}" "global_linux")
Expand All @@ -182,7 +182,7 @@ fi
BB='\033[1;34m'
RED='\033[1;31m'
NC='\033[0m'
if [[ "$OSTYPE" == "darwin"* ]]; then
if [[ "$OSTYPE" == .*darwin.* ]]; then
_shell_config="${HOME}/.zshrc"
else
_shell_config="${HOME}/.bashrc"
Expand Down
Loading