mirror of
https://github.com/sst/opencode.git
synced 2025-08-04 21:38:01 +00:00
fix: func called before definition (#1134)
This commit is contained in:
parent
18abcab208
commit
5c9d1910af
1 changed files with 14 additions and 14 deletions
28
install
28
install
|
@ -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}"
|
||||
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue