local-bin/link.sh

20 lines
341 B
Bash
Raw Normal View History

2020-07-01 13:42:14 +03:00
#!/bin/sh
2020-12-22 06:11:00 +02:00
node=$(uname -n)
node_files=($(ls $PWD/$node))
common_files=($(ls $PWD/common))
2020-07-01 13:42:14 +03:00
dest="$HOME/.local/bin"
# Ensure destination exists
if [ ! -d "$dest" ]; then
mkdir -p "$dest"
fi
2020-12-22 06:11:00 +02:00
for file in "${node_files[@]}"; do
ln -sf "$PWD/bin/$file" "$dest"
done
for file in "${common_files[@]}"; do
2020-07-01 13:42:14 +03:00
ln -sf "$PWD/bin/$file" "$dest"
done