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 }