Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 72 lines (58 sloc) 1.65 KB
if [ "$c" == "" ]; then
cat >&2 <<-ERR
Please set a valid '' npm config.
You can put PASSWORD in the setting somewhere to
have it prompt you for a password each time, so
it doesn't get dropped in your config file.
If you have PASSWORD in there, it'll also be read
from the PASSWORD environment variable, so you
can set it in the env and not have to enter it
each time.
exit 1
case $c in
if [ "$PASSWORD" == "" ]; then
echo -n "Password: "
read -s PASSWORD
# echo "couch=$c"
scratch_message () {
cat <<-EOF
Pushed to scratch ddoc. To make it real, use a COPY request.
Something like this:
curl -u "\$username:\$password" \\
\$couch/registry/_design/scratch \\
-X COPY \\
-H destination:'_design/app?rev=\$rev'
But, before you do that, make sure to fetch the views and give
them time to load, so that real users don't feel the pain of
view generation latency.
You can do it like this using npm:
npm run load
# Go get lunch and come back.
# Go take the dog for a walk, and play some frisbee in the park.
# If you don't have a dog, go get a puppy, provide it with love
# and appropriate discipline until it gets older, train it to play
# frisbee in the park, and then take it to the park and play frisbee.
# Wait some more. It's probably almost done now.
# Make it live:
npm run copy
c=${c// /%20}
which couchapp
couchapp push registry/shadow.js "$c" && \
couchapp push registry/app.js "$c" && \
scratch_message && \
exit 0 || \
( ret=$?
echo "Failed with code $ret"
exit $ret )