Files
dotFiles/home/.local/bin/update-npm-binaries
T

17 lines
364 B
Bash
Executable File

#!/bin/bash
NPM_DIR=~/node_modules;
TARGET_BIN_PATH=~/.local/bin;
PACKAGES_WITH_BIN=$( find "$NPM_DIR" -maxdepth 2 -name 'bin' );
cd $TARGET_BIN_PATH;
for i in $PACKAGES_WITH_BIN;do
echo "module: $i";
commands=$(ls $i);
echo "Commands: $commands";
for commandName in $commands;do
ln -s "$i/$commandName" "./$commandName";
done
done