Skip to content

Commit

Permalink
Switch to launchctl for Postgres
Browse files Browse the repository at this point in the history
`brew services` is no longer supported:

Homebrew/legacy-homebrew@c0b99c0

* Fixes thoughtbot#93
* Fixes thoughtbot#243
* Idempotently creates Postgres database cluster and starts (or restarts)
  Postgres.
  • Loading branch information
Dan Croak authored and bmorrall committed Dec 23, 2014
1 parent 1a7c3aa commit 5b42f4f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion mac
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,13 @@ fancy_echo "Installing NVM, Node.js, and NPM, for running apps and installing Ja
nvm alias default "$node_version"
### end mac-components/packages

fancy_echo "Ensure LaunchAgents exists ..."
mkdir -p ~/Library/LaunchAgents

fancy_echo "Starting Postgres ..."
brew services restart postgresql
ln -sfv /usr/local/opt/postgresql/*.plist ~/Library/LaunchAgents
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist >/dev/null
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist >/dev/null
### end mac-components/start-services

fancy_echo "Installing rbenv, to change Ruby versions ..."
Expand Down
7 changes: 6 additions & 1 deletion mac-components/start-services
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
fancy_echo "Ensure LaunchAgents exists ..."
mkdir -p ~/Library/LaunchAgents

fancy_echo "Starting Postgres ..."
brew services restart postgresql
ln -sfv /usr/local/opt/postgresql/*.plist ~/Library/LaunchAgents
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist >/dev/null
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist >/dev/null

0 comments on commit 5b42f4f

Please sign in to comment.