Created
January 10, 2020 05:24
-
-
Save bokuo-okubo/60473353008348d67c41ffeeb21643da to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -eux | |
CURRENT_DIR="$(pwd)" | |
WORK_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | |
echo "WORK_DIR to $WORK_DIR" | |
cd $WORK_DIR | |
for dir in */; do | |
cd $dir | |
(yarn unlink | :) | |
target_npm=$(yarn link | awk 'NR==2 { match($0, /\"(.*)\"/); v=substr($0, RSTART, RLENGTH); gsub(/\"/, "", v); print v }') | |
cd $CURRENT_DIR | |
yarn link "$target_npm" | |
cd $WORK_DIR | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment