dev 655 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
#!/bin/sh

# Runs command in requested directory and restores the working directory at the end.
# Usage: run <directory> "<command>"
runIn(){
	pushd $1 >/dev/null
	eval $2
	popd >/dev/null
}

echo "\n❤ Starting Better for development.\n"
echo "  · Opening iOS app workspace…\n"
open Better.xcworkspace

15 16 17 18 19 20 21
# Check that nothing else is running on port 3000 (which Builder uses)
lsof -t -i tcp:3000 >/dev/null 2>&1
if [[ $? == 0 ]]; then
	echo "Builder (or something else) is running on port 3000. Skipping running Builder…"
	exit 1
fi

22 23
echo "  · Starting Better Builder development environment…"
runIn ../builder ./dev | LC_ALL=C sed 's/^/      /g'