You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add install script and update release configuration
Adds install.sh script for easy installation of the latest release
binary via curl/wget on Linux (amd64/arm64). The script detects the
platform, downloads the appropriate release asset from GitHub, extracts
the 'reflow' binary, and installs it to /usr/local/bin using sudo.
Updates README.md to include the install script usage instructions and
replaces the dynamic Go version badge with a static one.
Updates .goreleaser.yml archive and release name templates to use
{{.Tag}} instead of {{.Version}} to include the 'v' prefix in artifact
names (e.g., reflow_v0.1.0_linux_amd64.tar.gz).
@@ -55,6 +55,16 @@ It automatically builds your Next.js app within Docker (no need for a Dockerfile
55
55
sudo mv reflow /usr/local/bin/
56
56
```
57
57
58
+
### Install Script (Linux)
59
+
60
+
You can install the latest version of Reflow using the following command. It automatically detects your architecture (amd64/arm64), downloads the correct release binary, and installs it to `/usr/local/bin`.
61
+
62
+
**Note:** This requires `curl` or `wget`, `tar`, and `sudo` privileges to write to `/usr/local/bin`.
tar -xzf "$DOWNLOAD_PATH" -C "$TMP_DIR" --strip-components=0 "$BINARY_NAME"|| \
115
+
tar -xzf "$DOWNLOAD_PATH" -C "$TMP_DIR" --strip-components=1 "$BINARY_NAME"|| \
116
+
error_exit "Failed to extract $BINARY_NAME from archive. Archive structure might have changed."
117
+
118
+
if [ !-f"$EXTRACTED_BINARY" ];then
119
+
error_exit "$BINARY_NAME not found after extraction."
120
+
fi
121
+
122
+
# --- Install ---
123
+
info "Making binary executable..."
124
+
chmod +x "$EXTRACTED_BINARY"
125
+
126
+
info "Attempting to install $BINARY_NAME to $INSTALL_DIR..."
127
+
if [ !-d"$INSTALL_DIR" ];then
128
+
info "Creating install directory $INSTALL_DIR (may require sudo)..."
129
+
if [ "$(id -u)"-ne 0 ];then
130
+
sudo mkdir -p "$INSTALL_DIR"|| error_exit "Failed to create $INSTALL_DIR using sudo."
131
+
else
132
+
mkdir -p "$INSTALL_DIR"|| error_exit "Failed to create $INSTALL_DIR."
133
+
fi
134
+
fi
135
+
136
+
if [ "$(id -u)"-ne 0 ];then
137
+
if!command -v sudo >/dev/null;then
138
+
error_exit "sudo command not found, cannot install to $INSTALL_DIR. Please run script with sudo or install manually: mv $EXTRACTED_BINARY$INSTALL_DIR/"
139
+
fi
140
+
info "Running 'sudo mv' to install..."
141
+
sudo mv "$EXTRACTED_BINARY""$INSTALL_DIR/$BINARY_NAME"|| error_exit "Failed to move binary to $INSTALL_DIR using sudo. Check permissions or run script with 'sudo bash'."
142
+
else
143
+
info "Running 'mv' as root to install..."
144
+
mv "$EXTRACTED_BINARY""$INSTALL_DIR/$BINARY_NAME"|| error_exit "Failed to move binary to $INSTALL_DIR."
145
+
fi
146
+
147
+
info ""
148
+
info "$BINARY_NAME version $LATEST_VERSION installed successfully to $INSTALL_DIR/$BINARY_NAME"
0 commit comments