Skip to content

Commit

Permalink
remove conda init script
Browse files Browse the repository at this point in the history
  • Loading branch information
BrightXiaoHan committed Oct 2, 2024
1 parent 9b9d0bc commit 0c7ab83
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 17 deletions.
4 changes: 0 additions & 4 deletions general/fish/config-osx.fish
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ if not contains $PATH "/opt/homebrew/bin"
fish_add_path /opt/homebrew/bin
end

if test -f ~/anaconda3/bin/conda
eval ~/anaconda3/bin/conda "shell.fish" "hook" $argv | source
end

if command -q pyenv 1>/dev/null 2>&1; and status --is-interactive
pyenv init - | source
end
Expand Down
13 changes: 0 additions & 13 deletions general/fish/config.fish
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,3 @@ end
if type zoxide > /dev/null 2>&1
zoxide init fish | source
end

# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
if test -f /opt/homebrew/Caskroom/miniconda/base/bin/conda
eval /opt/homebrew/Caskroom/miniconda/base/bin/conda "shell.fish" "hook" $argv | source
else
if test -f "/opt/homebrew/Caskroom/miniconda/base/etc/fish/conf.d/conda.fish"
. "/opt/homebrew/Caskroom/miniconda/base/etc/fish/conf.d/conda.fish"
else
set -x PATH "/opt/homebrew/Caskroom/miniconda/base/bin" $PATH
end
end
# <<< conda initialize <<<
30 changes: 30 additions & 0 deletions scripts/_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

get_latest_stable_nodejs_version() {
local url="https://nodejs.org/dist/index.json"
local temp_file=$(mktemp)

# Download the JSON data
if ! curl -s "$url" -o "$temp_file"; then
echo "Failed to retrieve the latest stable version of Node.js" >&2
rm "$temp_file"
return 1
fi

# Parse JSON and find the latest stable (LTS) version
local latest_version=$(jq -r '
map(select(.lts != false))
| sort_by(.date)
| reverse
| .[0].version
' "$temp_file")

rm "$temp_file"

if [[ -n "$latest_version" ]]; then
echo "$latest_version"
else
echo "Failed to parse the latest stable version of Node.js" >&2
return 1
fi
}

0 comments on commit 0c7ab83

Please sign in to comment.