diff --git a/.github/workflows/pre-release.yaml b/.github/workflows/pre-release.yaml index a855aa8b..49019380 100644 --- a/.github/workflows/pre-release.yaml +++ b/.github/workflows/pre-release.yaml @@ -34,7 +34,9 @@ jobs: with: tag_name: ${{ steps.extract_version.outputs.version }} name: Pre-Release ${{ steps.extract_version.outputs.version }} - files: ./linutil + files: | + ./linutil + ./start.sh generate_release_notes: true prerelease: true env: diff --git a/lindev.sh b/lindev.sh new file mode 100755 index 00000000..d9a4f693 --- /dev/null +++ b/lindev.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +# Function to fetch the latest release tag from the GitHub API +get_latest_release() { + local latest_release + latest_release=$(curl -s https://api.github.com/repos/ChrisTitusTech/linutil/releases | jq -r 'map(select(.prerelease == true)) | .[0].tag_name') + if [[ -z "$latest_release" ]]; then + echo "Error fetching release data" >&2 + return 1 + fi + echo "$latest_release" +} + +# Function to redirect to the latest pre-release version +redirect_to_latest_pre_release() { + local latest_release + latest_release=$(get_latest_release) + if [[ -n "$latest_release" ]]; then + local url="https://raw.githubusercontent.com/ChrisTitusTech/linutil/$latest_release/start.sh" + else + echo 'Unable to determine latest pre-release version.' >&2 + echo "Using latest Full Release" + local url="https://github.com/ChrisTitusTech/linutil/releases/latest/download/start.sh" + fi + curl -fsSL "$url" | sh +} + +redirect_to_latest_pre_release diff --git a/start.sh b/start.sh old mode 100644 new mode 100755