Migrating to hostname-based linker
This commit is contained in:
parent
0fbac556b8
commit
251a4bf209
7 changed files with 8 additions and 2 deletions
10
link.sh
10
link.sh
|
@ -1,6 +1,8 @@
|
|||
#!/bin/sh
|
||||
|
||||
files=($(ls $PWD/bin))
|
||||
node=$(uname -n)
|
||||
node_files=($(ls $PWD/$node))
|
||||
common_files=($(ls $PWD/common))
|
||||
dest="$HOME/.local/bin"
|
||||
|
||||
# Ensure destination exists
|
||||
|
@ -8,6 +10,10 @@ if [ ! -d "$dest" ]; then
|
|||
mkdir -p "$dest"
|
||||
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"
|
||||
done
|
||||
|
|
Loading…
Reference in a new issue