summaryrefslogtreecommitdiffhomepage
path: root/install
diff options
context:
space:
mode:
Diffstat (limited to 'install')
-rwxr-xr-xinstall28
1 files changed, 14 insertions, 14 deletions
diff --git a/install b/install
index 29e77c139..bc6107a20 100755
--- a/install
+++ b/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)