Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
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
700a3f0b
Commit
700a3f0b
authored
Sep 24, 2009
by
Robby Russell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding a script to check for upgrades
parent
f363c025
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
check_for_upgrade.sh
tools/check_for_upgrade.sh
+28
-0
No files found.
tools/check_for_upgrade.sh
0 → 100644
View file @
700a3f0b
#!/bin/sh
current_epoch
=
$(($(
date
+%s
)
/
60
/
60
/
24
))
if
[
-f
~/.zsh-update
]
then
source
~/.zsh-update
epoch_diff
=
$((
$current_epoch
-
$LAST_EPOCH
))
if
[
$epoch_diff
-gt
6
]
then
echo
"[Oh My Zsh] Would you like to check for updates?"
echo
"Type Y to update oh-my-zsh:
\c
"
read
line
if
[
"
$line
"
=
Y
]
||
[
"
$line
"
=
y
]
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
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