shakacode/react_on_rails

View on GitHub
node_package/scripts/symlink-node-package

Summary

Maintainability
Test Coverage
#!/bin/bash
# Update the example rails node packages

yarn run clean
yarn run build

# Ensure the paths will work no matter where we run the script from
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
root_path=${DIR}/../..

# Set up link
(cd $root_path && yarn link)

# Link the example apps to use react_on_rails node_package
examplesDir=${root_path}/gen-examples/examples
if [ -d $examplesDir ] ; then
  for type in $( ls $examplesDir ); do
    d=$examplesDir/${type}
    (cd $d && yalc link react-on-rails)
  done
fi