summary refs log tree commit diff stats
path: root/user/settings/fish/functions/delink.fish
blob: ff7ff64b072f04b5b4e9873fdcc72d6b87faf337 (plain)
1
2
3
4
5
6
7
8
9
10
function delink
    if test ! -L $argv[1]
        echo "$argv[1] is not a symlink"
        return 1
    end
    set -l src (readlink $argv[1])
    rm $argv[1]
    cp $src $argv[1]
    chmod u+w $argv[1]
end