summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--themes/macovsky.zsh-theme8
-rw-r--r--tools/check_for_upgrade.sh24
2 files changed, 23 insertions, 9 deletions
diff --git a/themes/macovsky.zsh-theme b/themes/macovsky.zsh-theme
new file mode 100644
index 000000000..db7f9148c
--- /dev/null
+++ b/themes/macovsky.zsh-theme
@@ -0,0 +1,8 @@
+# ZSH Theme - Preview: http://gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png
+local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
+
+PROMPT='%{$fg[green]%}%~%{$reset_color%} $(git_prompt_info)%{$reset_color%}%B$%b '
+RPS1="${return_code}"
+
+ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}‹"
+ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$reset_color%}" \ No newline at end of file
diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.sh
index 5c212b6fa..c59ebaed4 100644
--- a/tools/check_for_upgrade.sh
+++ b/tools/check_for_upgrade.sh
@@ -1,11 +1,22 @@
#!/bin/sh
-current_epoch=$(($(date +%s) / 60 / 60 / 24))
+function _current_epoch() {
+ echo $(($(date +%s) / 60 / 60 / 24))
+}
+
+function _update_zsh_update() {
+ echo "LAST_EPOCH=$(_current_epoch)" > ~/.zsh-update
+}
if [ -f ~/.zsh-update ]
then
. ~/.zsh-update
- epoch_diff=$(($current_epoch - $LAST_EPOCH))
+
+ if [[ -z "$LAST_EPOCH" ]]; then
+ _update_zsh_update && return 0;
+ fi
+
+ epoch_diff=$((${_current_epoch} - $LAST_EPOCH))
if [ $epoch_diff -gt 6 ]
then
echo "[Oh My Zsh] Would you like to check for updates?"
@@ -15,14 +26,9 @@ then
then
/bin/sh $ZSH/tools/upgrade.sh
fi
-
- # Set the last epoch to the current so that we don't ask for another week
- echo "LAST_EPOCH=${current_epoch}" > ~/.zsh-update
fi
-else
- # TODO: refactor this so remove duplicates
- # Create the ~/.zsh-update file with the current epoch info
- echo "LAST_EPOCH=${current_epoch}" > ~/.zsh-update
fi
+# update the zsh file
+_update_zsh_update