GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — ci: rollback install script · almonk/opencode@c87a746

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • install
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎install‎

Copy file name to clipboardExpand all lines: install
+13-26Lines changed: 13 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,20 @@ case "$filename" in
4141
;;
4242
esac
4343

44-
# Determine installation directory with priority order
45-
if [ -n "${OPENCODE_INSTALL_DIR:-}" ]; then
46-
INSTALL_DIR="$OPENCODE_INSTALL_DIR"
47-
elif [ -n "${XDG_BIN_DIR:-}" ]; then
48-
INSTALL_DIR="$XDG_BIN_DIR"
49-
elif [ -d "$HOME/bin" ] || mkdir -p "$HOME/bin" 2>/dev/null; then
50-
INSTALL_DIR="$HOME/bin"
44+
INSTALL_DIR=$HOME/.opencode/bin
45+
mkdir -p "$INSTALL_DIR"
46+
47+
if [ -z "$requested_version" ]; then
48+
url="https://github.com/sst/opencode/releases/latest/download/$filename"
49+
specific_version=$(curl -s https://api.github.com/repos/sst/opencode/releases/latest | awk -F'"' '/"tag_name": "/ {gsub(/^v/, "", $4); print $4}')
50+
51+
if [[ $? -ne 0 || -z "$specific_version" ]]; then
52+
echo "${RED}Failed to fetch version information${NC}"
53+
exit 1
54+
fi
5155
else
52-
INSTALL_DIR="$HOME/.opencode/bin"
56+
url="https://github.com/sst/opencode/releases/download/v${requested_version}/$filename"
57+
specific_version=$requested_version
5358
fi
5459

5560
print_message() {
@@ -66,23 +71,6 @@ print_message() {
6671
echo -e "${color}${message}${NC}"
6772
}
6873

69-
mkdir -p "$INSTALL_DIR"
70-
71-
print_message info "Installing to: ${YELLOW}$INSTALL_DIR${GREEN}"
72-
73-
if [ -z "$requested_version" ]; then
74-
url="https://github.com/sst/opencode/releases/latest/download/$filename"
75-
specific_version=$(curl -s https://api.github.com/repos/sst/opencode/releases/latest | awk -F'"' '/"tag_name": "/ {gsub(/^v/, "", $4); print $4}')
76-
77-
if [[ $? -ne 0 || -z "$specific_version" ]]; then
78-
echo "${RED}Failed to fetch version information${NC}"
79-
exit 1
80-
fi
81-
else
82-
url="https://github.com/sst/opencode/releases/download/v${requested_version}/$filename"
83-
specific_version=$requested_version
84-
fi
85-
8674
check_version() {
8775
if command -v opencode >/dev/null 2>&1; then
8876
opencode_path=$(which opencode)
@@ -198,4 +186,3 @@ if [ -n "${GITHUB_ACTIONS-}" ] && [ "${GITHUB_ACTIONS}" == "true" ]; then
198186
echo "$INSTALL_DIR" >> $GITHUB_PATH
199187
print_message info "Added $INSTALL_DIR to \$GITHUB_PATH"
200188
fi
201-

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.