Skip to content
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

Formatting, compatibility, and simplification #4

Merged
merged 2 commits into from Feb 23, 2017

Conversation

lfkeitel
Copy link
Contributor

As the commits say, I fixed some formatting inconsistencies and converted the if statements to a more standard syntax. This should mean it's compatible with more than just Bash and zsh but I haven't test yet. I also consolidated the two dot files into one. And, a test file! All the test does is override the water time and run the functions. There's no checking it just runs to manually make sure the results look correct.

There were a few formatting inconsistencies like indention or using
grave instead $() for command substitution.

All information is now kept in a single file $HOME/.water. The first
line is the true/false, the second is the unix timestamp.

Replaced all conditionals with POSIX style statements. This should make
it compatible with more POSIX shells.

The WATER_TIME variable will take an already defined value and fallback
to the default of 10800. This allows a user to set the variable outside
of the script and not have to mess with it at all.

The .water file will be made automatically if it doesn't exist. The
first time I ran it, I got an err from cat because the file didn't
exist yet. That will no longer be the case.
@kalbhor
Copy link
Owner

kalbhor commented Feb 23, 2017

This is great! Tried and tested, it works well. Also, I just found out that I had put the spaceship_user() function in the script by mistake. That function was related to my theme and not related to drink_water.

@kalbhor kalbhor merged commit 1a21152 into kalbhor:master Feb 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants