localinstall/localinstall.sh

18 lines
278 B
Bash
Executable File

#!/usr/bin/env sh
# Symlink binaries into my ~/.local/bin directory.
set -o errexit
set -o nounset
file=$1
install_dir="${HOME}/.local/bin"
filepath=$(readlink -f "$file")
filename=$(basename "$file")
mkdir -p $install_dir
ln -sf "$filepath" "${install_dir}/${filename}"