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
28 changes: 14 additions & 14 deletions install
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,20 @@ else
INSTALL_DIR="$HOME/.opencode/bin"
fi

print_message() {
local level=$1
local message=$2
local color=""

case $level in
info) color="${GREEN}" ;;
warning) color="${YELLOW}" ;;
error) color="${RED}" ;;
esac

echo -e "${color}${message}${NC}"
}

mkdir -p "$INSTALL_DIR"

print_message info "Installing to: ${YELLOW}$INSTALL_DIR${GREEN}"
Expand All @@ -69,20 +83,6 @@ else
specific_version=$requested_version
fi

print_message() {
local level=$1
local message=$2
local color=""

case $level in
info) color="${GREEN}" ;;
warning) color="${YELLOW}" ;;
error) color="${RED}" ;;
esac

echo -e "${color}${message}${NC}"
}

check_version() {
if command -v opencode >/dev/null 2>&1; then
opencode_path=$(which opencode)
Expand Down