Created
April 1, 2019 09:52
-
-
Save Glutexo/1fe30248c8edd75763f5a9d4eed1db22 to your computer and use it in GitHub Desktop.
Open PgAdmin 4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| =begin | |
| PgAdmin 4 runs on a random port. Once you close its browser window, there | |
| is no way to get back to it. But it stores its address in a hidden file. | |
| This script finds the file and opens the address inside in a default | |
| browser. | |
| =end | |
| path = File::expand_path('~') | |
| filename = Dir.new(path).entries.find do |item| | |
| item.match?(/^\.pgAdmin4\.\d+\.addr$/) | |
| end | |
| addr = File.read(filename).chomp | |
| exec('open', addr) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment