18 lines
290 B
Bash
18 lines
290 B
Bash
#!/usr/bin/env bash
|
|
|
|
target=${args[target]:?}
|
|
url=${args[url]:?}
|
|
|
|
if [ ! -f "$target" ]
|
|
then
|
|
echo "Installing archive $url to $target"
|
|
|
|
target_dir=$(dirname "$target")
|
|
mkdir -p "$target_dir"
|
|
cd "$target_dir" || exit 1
|
|
|
|
_http_client "$url" > "$target"
|
|
tar xaf "$target"
|
|
|
|
_run_hook
|
|
fi
|