Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
github
oh-my-zsh
Commits
41f13ccb
Commit
41f13ccb
authored
Dec 12, 2009
by
Robby Russell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updating check_for_upgrade script to fix issue when the LAST_EPOCH file/value…
Updating check_for_upgrade script to fix issue when the LAST_EPOCH file/value got corrupted. Closes #32
parent
473dd3b2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
9 deletions
+15
-9
check_for_upgrade.sh
tools/check_for_upgrade.sh
+15
-9
No files found.
tools/check_for_upgrade.sh
View file @
41f13ccb
#!/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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment