Migrating to hostname-based linker

This commit is contained in:
Siina Mashek 2020-12-22 06:11:00 +02:00
parent 0fbac556b8
commit 251a4bf209
7 changed files with 8 additions and 2 deletions

View File

10
link.sh
View File

@ -1,6 +1,8 @@
#!/bin/sh #!/bin/sh
files=($(ls $PWD/bin)) node=$(uname -n)
node_files=($(ls $PWD/$node))
common_files=($(ls $PWD/common))
dest="$HOME/.local/bin" dest="$HOME/.local/bin"
# Ensure destination exists # Ensure destination exists
@ -8,6 +10,10 @@ if [ ! -d "$dest" ]; then
mkdir -p "$dest" mkdir -p "$dest"
fi fi
for file in "${files[@]}"; do for file in "${node_files[@]}"; do
ln -sf "$PWD/bin/$file" "$dest"
done
for file in "${common_files[@]}"; do
ln -sf "$PWD/bin/$file" "$dest" ln -sf "$PWD/bin/$file" "$dest"
done done