mirror of
https://github.com/sadan4/dotfiles.git
synced 2025-06-22 04:07:00 -04:00
20 lines
369 B
Bash
20 lines
369 B
Bash
#!/usr/bin/env bash
|
|
set -eo pipefail
|
|
|
|
function echoe() {
|
|
echo $@ 1>&2
|
|
}
|
|
|
|
function printUsage() {
|
|
echoe "Usage: ${0} FILE"
|
|
echoe "Unlink a file by copying the original file to the link path"
|
|
echoe "Shorthand for cp -P \$(readlink \$FILE) $FILE"
|
|
}
|
|
|
|
if [[ -z $1 ]]; then
|
|
echoe "${0}: missing file"
|
|
printUsage
|
|
exit 1
|
|
fi
|
|
|
|
cp -P $(readlink $1) $1
|