From 1535c7599311705996883adb8ed2fa0d61fbbe09 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Sat, 4 Nov 2023 16:29:25 +0100 Subject: [PATCH] install the runner in /usr/local/bin * when downloaded * when built from sources --- forgejo-runner-lib.sh | 4 ++-- forgejo-runner.sh | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/forgejo-runner-lib.sh b/forgejo-runner-lib.sh index ccdd83d..b3b4375 100644 --- a/forgejo-runner-lib.sh +++ b/forgejo-runner-lib.sh @@ -36,7 +36,7 @@ function build_runner() { git checkout "$version" make build ) - mv $dir/forgejo-runner/forgejo-runner . - ./forgejo-runner --version + mv $dir/forgejo-runner/forgejo-runner /usr/local/bin + forgejo-runner --version rm -fr "$dir" } diff --git a/forgejo-runner.sh b/forgejo-runner.sh index e2fb54e..3731042 100755 --- a/forgejo-runner.sh +++ b/forgejo-runner.sh @@ -20,11 +20,11 @@ function download() { local version="$2" if ! which forgejo-runner > /dev/null; then - if ! curl -L --fail -sS $runner_repository/releases/download/$version/forgejo-runner-${version#v}-linux-amd64 > /bin/forgejo-runner ; then + if ! curl -L --fail -sS $runner_repository/releases/download/$version/forgejo-runner-${version#v}-linux-amd64 > /usr/local/bin/forgejo-runner ; then # backward compatibility for for the naming scheme prior to 3.0.0 - curl -L --fail -sS $runner_repository/releases/download/$version/forgejo-runner-linux-amd64 > /bin/forgejo-runner + curl -L --fail -sS $runner_repository/releases/download/$version/forgejo-runner-linux-amd64 > /usr/local/bin/forgejo-runner fi - chmod 755 /bin/forgejo-runner + chmod 755 /usr/local/bin/forgejo-runner fi }