Skip to content

Commit

Permalink
fix: config set MacOS, help wrong command
Browse files Browse the repository at this point in the history
  • Loading branch information
av committed Sep 25, 2024
1 parent e7d7ac1 commit 7a575c5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions harbor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ show_help() {
echo " cmdh - Run cmdh CLI"
echo " parllama - Launch Parllama - TUI for chatting with Ollama models"
echo " bench - Run and manage Harbor Bench"
echi " openhands|oh - Run OpenHands service"
echo " openhands|oh - Run OpenHands service"
echo " hf - Run the Harbor's Hugging Face CLI. Expanded with a few additional commands."
echo " hf dl - HuggingFaceModelDownloader CLI"
echo " hf parse-url - Parse file URL from Hugging Face"
Expand Down Expand Up @@ -958,7 +958,12 @@ env_manager() {
shift 2 # Remove 'set' and the key from the arguments
local value="$*" # Capture all remaining arguments as the value
if grep -q "^$prefix$upper_key=" "$env_file"; then
sed -i "s|^$prefix$upper_key=.*|$prefix$upper_key=\"$value\"|" "$env_file"
# Remove trailing newlines from the temp file
if [[ "$(uname)" == "Darwin" ]]; then
sed -i '' "s|^$prefix$upper_key=.*|$prefix$upper_key=\"$value\"|" "$env_file"
else
sed -i "s|^$prefix$upper_key=.*|$prefix$upper_key=\"$value\"|" "$env_file"
fi
else
echo "$prefix$upper_key=\"$value\"" >>"$env_file"
fi
Expand Down

0 comments on commit 7a575c5

Please sign in to comment.