localinstall/localinstall.sh

20 lines
350 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"
mkdir -p $install_dir
path=$(dirname "$file")
filename=$(basename "$file")
canonical_path=$(cd "$path" && pwd -P)
filepath="${canonical_path}/${filename}"
ln -sf "$filepath" "${install_dir}/${filename}"