GeezerVison is showing github.com — fix: func called before definition (#1134) · ccheever/opencode@5c9d191
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: install +14-14Lines changed: 14 additions & 14 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
52 | 52 | INSTALL_DIR="$HOME/.opencode/bin" |
53 | 53 | fi |
54 | 54 |
|
| 55 | +print_message() { |
| 56 | + local level=$1 |
| 57 | + local message=$2 |
| 58 | + local color="" |
| 59 | + |
| 60 | + case $level in |
| 61 | + info) color="${GREEN}" ;; |
| 62 | + warning) color="${YELLOW}" ;; |
| 63 | + error) color="${RED}" ;; |
| 64 | + esac |
| 65 | + |
| 66 | + echo -e "${color}${message}${NC}" |
| 67 | +} |
| 68 | + |
55 | 69 | mkdir -p "$INSTALL_DIR" |
56 | 70 |
|
57 | 71 | print_message info "Installing to: ${YELLOW}$INSTALL_DIR${GREEN}" |
|
69 | 83 | specific_version=$requested_version |
70 | 84 | fi |
71 | 85 |
|
72 | | -print_message() { |
73 | | - local level=$1 |
74 | | - local message=$2 |
75 | | - local color="" |
76 | | - |
77 | | - case $level in |
78 | | - info) color="${GREEN}" ;; |
79 | | - warning) color="${YELLOW}" ;; |
80 | | - error) color="${RED}" ;; |
81 | | - esac |
82 | | - |
83 | | - echo -e "${color}${message}${NC}" |
84 | | -} |
85 | | - |
86 | 86 | check_version() { |
87 | 87 | if command -v opencode >/dev/null 2>&1; then |
88 | 88 | opencode_path=$(which opencode) |
|