Commit c43b2492 authored by Dan Abramov's avatar Dan Abramov
Browse files

Fix tasks

parent 841ae047
Showing with 8 additions and 7 deletions
+8 -7
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
# We call this as part of the `release.sh` script. # We call this as part of the `release.sh` script.
# On success, the only output to stdout is the package name. # On success, the only output to stdout is the package name.
# Start even if run from root directory # Start in /tasks even if run from root directory
cd "$(dirname "$0")" cd "$(dirname "$0")"
# Print error messages to stderr. # Print error messages to stderr.
...@@ -46,7 +46,7 @@ cd .. ...@@ -46,7 +46,7 @@ cd ..
# Create a temporary clean folder that contains production-only code. # Create a temporary clean folder that contains production-only code.
# Do not overwrite any files in the current folder. # Do not overwrite any files in the current folder.
clean_path=`mktemp -d clean_XXXX` clean_path=`mktemp -d 2>/dev/null || mktemp -d -t 'clean_path'`
# Copy some of the project files to the temporary folder. # Copy some of the project files to the temporary folder.
# Exclude folders that definitely won’t be part of the package from processing. # Exclude folders that definitely won’t be part of the package from processing.
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
# LICENSE file in the root directory of this source tree. An additional grant # LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory. # of patent rights can be found in the PATENTS file in the same directory.
# Start in tests/ even if run from root directory # Start in tasks/ even if run from root directory
cd "$(dirname "$0")" cd "$(dirname "$0")"
function cleanup { function cleanup {
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
# LICENSE file in the root directory of this source tree. An additional grant # LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory. # of patent rights can be found in the PATENTS file in the same directory.
# Start in tests/ even if run from root directory # Start in tasks/ even if run from root directory
cd "$(dirname "$0")" cd "$(dirname "$0")"
# Exit the script on any command with non 0 return code # Exit the script on any command with non 0 return code
...@@ -19,6 +19,7 @@ set -x ...@@ -19,6 +19,7 @@ set -x
# Go to root # Go to root
cd .. cd ..
root_path=$PWD
# You can only release with npm >= 3 # You can only release with npm >= 3
if [ $(npm -v | head -c 1) -lt 3 ]; then if [ $(npm -v | head -c 1) -lt 3 ]; then
...@@ -33,14 +34,14 @@ fi ...@@ -33,14 +34,14 @@ fi
# Create a temporary clean folder that contains production only code. # Create a temporary clean folder that contains production only code.
# Do not overwrite any files in the current folder. # Do not overwrite any files in the current folder.
clean_path=`mktemp -d clean_XXXX` clean_path=`mktemp -d 2>/dev/null || mktemp -d -t 'clean_path'`
# Copy some of the project files to the temporary folder. # Copy some of the project files to the temporary folder.
# Exclude folders that definitely won’t be part of the package from processing. # Exclude folders that definitely won’t be part of the package from processing.
# We will strip the dev-only code there, and then copy files back. # We will strip the dev-only code there, and then copy files back.
rsync -av --exclude='.git' --exclude=$clean_path\ rsync -av --exclude='.git' --exclude=$clean_path\
--exclude='node_modules' --exclude='build'\ --exclude='node_modules' --exclude='build'\
'./' '$clean_path' >/dev/null './' $clean_path >/dev/null
# Now remove all the code relevant to development of Create React App. # Now remove all the code relevant to development of Create React App.
cd $clean_path cd $clean_path
...@@ -64,7 +65,7 @@ npm dedupe ...@@ -64,7 +65,7 @@ npm dedupe
rm -rf node_modules/fsevents rm -rf node_modules/fsevents
# This modifies $clean_path/package.json to copy all dependencies to bundledDependencies # This modifies $clean_path/package.json to copy all dependencies to bundledDependencies
node ./node_modules/.bin/bundle-deps node $root_path/node_modules/.bin/bundle-deps
# Go! # Go!
npm publish "$@" npm publish "$@"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment