Commit 4b9cb684 authored by Simon Schürg's avatar Simon Schürg 🚀
Browse files

feat(scripts): add script to install from source

parent d17414fd
......@@ -28,5 +28,5 @@ go run actl.go docs
mkdir ./completions
go run actl.go completion bash > ./completions/actl.bash
go run actl.go completion zsh > ./completions/actl.zsh
go run actl.go completion fish > ./completions/actl.fish
go run actl.go completion zsh > ./completions/actl.zsh
#!/usr/bin/env bash
#
#
# Simon Schürg <simon@schuerg.net>
# Exit on error. Append "|| true" if you expect an error.
set -o errexit
# Exit on error inside any functions or subshells.
set -o errtrace
# Do not allow use of undefined vars. Use ${VAR:-} to use an undefined VAR
set -o nounset
# Catch the error in case mysqldump fails (but gzip succeeds) in `mysqldump |gzip`
set -o pipefail
# Turn on traces, useful while debugging but commented out by default
# set -o xtrace
# Set magic variables for current file, directory, os, etc.
__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
__file="${__dir}/$(basename "${BASH_SOURCE[0]}")"
__base="$(basename "${__file}" .sh)"
# cd in the project root
cd "${__dir}/.."
BUILD_DIR=$(mktemp -d)
go build -o ${BUILD_DIR}/actl actl.go
cd ${BUILD_DIR}
./actl docs
sudo cp docs/man/* /usr/share/man/man3
sudo sh -c './actl completion bash > /usr/share/bash-completion/completions/actl'
sudo sh -c './actl completion fish > /usr/share/zsh/site-functions/_actl'
sudo sh -c './actl completion zsh > /usr/share/fish/completions/actl.fish'
sudo mv ${BUILD_DIR}/actl /usr/local/bin/actl
cd "${__dir}/.."
sudo mkdir --verbose -p /etc/actl
# Copy if not exists, do not overwrite
sudo cp --verbose --no-clobber actl.toml /etc/actl/actl.toml
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment