Checking uname before trying to link node
This commit is contained in:
parent
95a728eba5
commit
51b18cd057
10
link.sh
10
link.sh
|
@ -1,7 +1,6 @@
|
|||
#!/bin/sh
|
||||
|
||||
node=$(uname -n)
|
||||
node_files=($(ls $PWD/$node))
|
||||
common_files=($(ls $PWD/common))
|
||||
dest="$HOME/.local/bin/"
|
||||
|
||||
|
@ -10,9 +9,12 @@ if [ ! -d "$dest" ]; then
|
|||
mkdir -p "$dest"
|
||||
fi
|
||||
|
||||
for file in "${node_files[@]}"; do
|
||||
ln -sf "$PWD/$node/$file" "$dest"
|
||||
done
|
||||
if [ -f "$node" ]; then
|
||||
node_files=($(ls $PWD/$node))
|
||||
for file in "${node_files[@]}"; do
|
||||
ln -sf "$PWD/$node/$file" "$dest"
|
||||
done
|
||||
fi
|
||||
|
||||
for file in "${common_files[@]}"; do
|
||||
ln -sf "$PWD/common/$file" "$dest"
|
||||
|
|
Loading…
Reference in New Issue