Skip to content

Instantly share code, notes, and snippets.

@RazZziel
Created March 5, 2015 00:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RazZziel/1e6298a49a6907801d2f to your computer and use it in GitHub Desktop.
Save RazZziel/1e6298a49a6907801d2f to your computer and use it in GitHub Desktop.
Setup and run ddp-analyzer-proxy + meteor
#!/bin/bash
# https://meteorhacks.com/introduction-to-ddp.html
# https://meteorhacks.com/discover-meteor-ddp-in-realtime.html
if which ddp-analyzer-proxy 2>/dev/null; then
echo "ddp-analyzer-proxy found in $(which ddp-analyzer-proxy)"
elif [ -f $(npm root)/.bin/ddp-analyzer-proxy ]; then
echo "ddp-analyzer-proxy found in $(npm root)/.bin/ddp-analyzer-proxy"
export PATH="$(npm root)/.bin/:$PATH"
else
echo "Installing ddp-analyzer..."
mkdir ~/node_modules
npm install ddp-analyzer
export PATH="$(npm root)/.bin/:$PATH"
fi
export DDP_DEFAULT_CONNECTION_URL=http://localhost:3030
screenrc=$(mktemp)
cat > $screenrc <<END
hardstatus alwayslastline
hardstatus string '(%{yk}%H%{gk})%{= kG}[%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f %t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %d/%m %{W}%c %{g}]'
screen -t ddp-analyzer 0 ddp-analyzer-proxy
screen -t meteor 1 meteor
END
screen -c $screenrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment