File: install.sh

package info (click to toggle)
bash-unit 2.3.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,304 kB
  • sloc: sh: 1,134; makefile: 10
file content (16 lines) | stat: -rwxr-xr-x 605 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/env bash

set -euo pipefail

CURL="curl --show-error --silent --location"

echo "downloading bash_unit"
current_working_dir=$PWD
tarball_urls=$($CURL https://api.github.com/repos/pgrange/bash_unit/releases | grep tarball_url)
tarball_url=$(echo "$tarball_urls" | head -n 1 | cut -d '"' -f 4)
tmp_dir=$(mktemp -d 2>/dev/null || mktemp -d -t 'tmpdir')
cd "$tmp_dir" || exit
$CURL "$tarball_url" | tar -xz -f -
find "${tmp_dir}" -maxdepth 2 -type f -name "bash_unit" -exec cp {} "${current_working_dir}" \;
rm -rf "$tmp_dir"
echo "thank you for downloading bash_unit, you can now run ./bash_unit"