-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix and improvements for postgres and asdf #38
Conversation
195df02
to
5136832
Compare
5136832
to
e847c7f
Compare
postgres
and asdf
. Also included check for existing posgres installation
postgres
and asdf
. Also included check for existing posgres installation560b0d3
to
e6f160e
Compare
b637faf
to
e6f160e
Compare
@@ -212,17 +215,17 @@ install_asdf_erlang() { | |||
|
|||
install_asdf_elixir() { | |||
# shellcheck disable=SC1090 | |||
. "$(brew --prefix asdf)/asdf.sh" | |||
. "$(brew --prefix asdf)/libexec/asdf.sh" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move it to a separate method? So, in case it is changed in the future, we don't need to modify it again in all places.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A method or a variable? Unsure to be honest, maybe we can do this in a refactor task if needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure
@@ -301,7 +304,7 @@ append_web_dependencies() { | |||
brew "imagemagick" | |||
|
|||
# Databases | |||
brew "postgres" | |||
brew "postgresql@14" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is worth to do option from "Potential improvements" in this PR:
Make a global variable for postgresql version number
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about it but wasn't 100% sure the version number would directly map to the folder paths in the future, and unsure if we will remove/refactor the setup_postgres
where it's used 3 out of the 4 times.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok
@@ -106,6 +106,9 @@ config_zsh() { | |||
|
|||
zsh_config_homebrew | |||
|
|||
# shellcheck disable=SC2016 | |||
append_to_zshrc 'export PATH=~/.asdf/shims:$PATH' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we added it here, should we remove it from install_asdf()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so because if the user decides to not install oh-my-zsh
at the last step they won't have it at all.
Close #37
What happened
postgres
topostgresql@<version>
asdf.sh
is situated inside an additional directory/libexec
during install so the paths have been updatedshims
export in .zshrc as it had a trailing"
so the commands wouldn't be available (I actually added an opening"
with$HOME
instead of keeping existing~
and deleting the trailing comma. I think this change is same.oh-my-zsh
add-on was chosen at the end (because it overwrites it). If this isn't added then the same errors "command not found" would re-occur again.and
the function responsible for starting/stopping postgres service and creating the new database user.Insight
postgresql
seems to be required forbrew
. The following error is shown if just changed topostgresql
without version:So have chosen
14
which would be14.7
which is only a few months old (didn't want to try 15 but willing to change)./Applications/Postgres.app
(https://postgresapp.com) in addition to brew in case a user has an existing installation by this method instead (willing to change)Potential improvements
which
to a folder check depending on if M1 or otherwise for existing postgres check.Proof Of Work
Success output when running script - https://pastebin.com/N8kVaTBE