Marc Cornellà
0b0af4df6a
fix(updater): fix check for latest commit in local repository
...
The previous check simply compared whether the last commit of the branch
was the same in the local and the remote repository.
This commit also checks whether the remote commit is an ancestor of the
local commit. This fixes the case where the local repository has new
commits after the last published commit.
2022-02-24 13:51:16 +01:00
Marc Cornellà
ff29836562
fix(updater): timeout after 2s on available update check
2022-02-24 13:51:16 +01:00
Marc Cornellà
69e2937891
fix(updater): fix input check on non-interactive runs
...
Reference: https://www.zsh.org/mla/users/2022/msg00067.html
2022-02-11 19:51:52 +01:00
Marc Cornellà
dbd92a62ce
fix(updater): do not swallow 1 character in check for user input
...
Co-authored-by: Philippe Troin <phil@fifi.org>
2022-02-11 10:04:51 +01:00
Marc Cornellà
f0f42828fa
feat(updater): do not update when user already typed some characters ( #9699 )
...
Fixes #9699
2022-02-07 18:58:47 +01:00
Marc Cornellà
84931adcd4
fix: do not call chpwd hooks in subshells
2022-01-22 22:07:09 +01:00
Marc Cornellà
805427e06b
fix(updater): give priority to zstyle
settings if set ( #10587 )
...
Fixes #10587
2022-01-13 17:28:15 +01:00
Nick Aldwin
c66fc00401
feat(updater): show command to update when update skipped ( #10465 )
2021-12-01 12:44:15 +01:00
Marc Cornellà
2b96b7c54b
fix(updater): stop update if $ZSH
is not a git repository ( #10448 )
...
Fixes #10448
2021-11-25 23:36:38 +01:00
Marc Cornellà
e3f7b8aa57
fix(updater): avoid git -C
for compatibility with git < v1.8.5 ( #10404 )
...
Fixes #10404
2021-11-10 11:21:59 +01:00
Marc Cornellà
db19589fcf
refactor(updater): simplify check for available updates
2021-11-09 19:56:53 +01:00
Marc Cornellà
7a2cb10625
fix(updater): stop update if connection unavailable
2021-11-05 19:47:29 +01:00
Marc Cornellà
30d441713c
feat(updater): check if there are updates before prompting ( #8387 )
...
Fixes #8387
2021-10-04 10:47:10 +02:00
Marc Cornellà
0120749a54
feat(updater): add mode to only remind you to update when it's time ( #10187 )
...
Fixes #10187
Co-authored-by: NoPreserveRoot <NoPreserveRoot@pm.me>
2021-10-04 10:47:10 +02:00
Marc Cornellà
3c9743313c
refactor(updater): change auto-update settings to use zstyle
2021-10-04 10:47:10 +02:00
Marc Cornellà
36f444ed73
fix(update): fix error exit code on update check ( #10033 )
...
This patch removes the 'exit 1' status code when the update check
finishes or is ended with CTRL+C.
Fixes #10033
2021-07-08 16:11:16 +02:00
Cai Cooper
6fbad5bf72
fix(update): don't error on upgrade no-op ( #9685 )
...
* Don't error on upgrade no-op
No error code is required for a non failure scenario.
* Manually check whether changes were pulled in `omz update`
Co-authored-by: Marc Cornellà <hello@mcornella.com>
2021-03-01 08:17:54 +01:00
Marc Cornellà
d978f385e5
fix(updater): refresh date of last update only on successful update
2021-01-21 11:52:09 +01:00
Marc Cornellà
5a888ff4ac
fix(updater): don't show changelog when running unattended update ( #9495 )
...
Fixes #9495
2020-12-07 20:58:12 +01:00
Marc Cornellà
889cd7acf3
refactor(updater): switch to Zsh execution and fix git remote detection logic
2020-11-30 15:48:46 +01:00
M. Yas. Davoodeh
5c1a5c6ce9
update: prefix rm call with command in trap ( #9107 )
...
* Suppress the problematic trap output in check_upg
The newly added trap, in systems where `rm` is aliased to `rm="rm -v"`,
shows a message stating that "update.lock" has been removed each time `zsh` is called.
I simply suppressed it with directing the output to `/dev/null`.
* Use `command` instead of >/dev/null to suppress
2020-07-13 11:52:28 +02:00
Marc Cornellà
97cf0bf4bd
update: change dash in function name for sh compat ( fixes #9064 )
2020-06-28 18:54:59 +02:00
alexagnelli
48b98b957e
update: only update on a valid affirmative input ( #9062 )
...
Co-authored-by: Marc Cornellà <marc.cornella@live.com>
2020-06-28 18:34:02 +02:00
Marc Cornellà
3c777ebf1b
update: refactor and fix logic in check_for_upgrade.sh ( #8939 )
2020-06-09 19:38:08 +02:00
Marc Cornellà
c23ab00990
upgrade: fix lock-out on first upgrade check
...
This early return made it so the lock wasn't removed, therefore locking out
the upgrade script from ever entering the upgrade routine.
Fixes #6138
Note: the logic needs some rework.
2019-04-07 20:39:25 +02:00
Chao Du
de8299d6c4
Fixed Issue #4550 : Move ~/.zsh-update file to $ZSH_CACHE_DIR
2018-06-15 23:43:21 +02:00
Gert de Pagter
2b7a41b0d2
Update the update prompt ( #6825 )
...
`[Oh My Zsh] Would you like to check for updates? [Y/n]: ` does not make sense,
since answering yes will download/apply the new updates instead of checking for them.
2018-05-15 11:26:59 +02:00
Fabian Wolff
1f64fa92f5
Convert "if then" statements to "if; then" one-liners
2016-10-03 12:05:10 +02:00
Fabian Wolff
4fa6be0230
Use rmdir instead of rm -r
2016-10-03 12:05:10 +02:00
Fabian Wolff
40bfe5a412
Implement a locking mechanism to avoid multiple update prompts ( fixes #3766 )
2016-10-03 12:05:10 +02:00
Fredrik Fornwall
9772f8e10d
Replace /bin/sh with sh for portability ( #5291 )
...
This makes things work even on system lacking /bin/sh, such as on
non-rooted Android systems.
2016-08-09 02:39:11 +02:00
Marc Cornellà
ef031dfe8f
Merge pull request #4207 from mpscholten/master
...
Also accept any forms of yes as an answer to the "do you want to update?" prompt
2015-11-29 14:34:14 +01:00
Arvind Chembarpu
e59e1c8417
Check for git before trying to upgrade, as per #4504
2015-10-16 23:19:55 +05:30
Marc Scholten
d351c76b04
Also accept any forms of yes as an answer to the "do you want to update?" prompt
2015-08-03 14:50:57 +02:00
HeroCC
6a1b8320fe
No input for Update Check defaults to Yes
2015-06-10 14:36:52 +02:00
Mark Feltner
83553597a1
fix(tools/check_for_upgrade): Don't source profile
...
Reverts #2296 , but mostly #1883 .
There is no need to source ~/.profile when this script is read. oh-my-zsh writes no configuration data in ~/.profile.
If the user wishes to use data within ~/.profile, then they should source it in another place.
Fixes #2315
2014-12-15 18:45:50 +01:00
Robby Russell
57ff83db59
Merge pull request #2946 from moinakg/master
...
Solaris portability tweaks.
2014-11-06 09:26:48 -08:00
Moinak Ghosh
3a39732845
Change to epoch target in days instead of seconds.
2014-10-14 12:05:01 +05:30
Moinak Ghosh
90762eee49
Convert epoch_target from days to seconds.
2014-09-17 11:11:48 +05:30
Moinak Ghosh
5f38a537ce
Update Solaris changes to use OSTYPE and zsh datetime module.
2014-09-16 22:29:52 +05:30
Fredrik Fornwall
dac2a6e27a
Replace /usr/bin/env with env
...
Some environments (such as Android) does not have /usr/bin.
2014-08-20 23:52:05 +02:00
Moinak Ghosh
5e328e3a9c
Solaris portability tweaks.
2014-07-11 18:41:49 +05:30
n.st
a9e1d9aa89
Cancel upgrade if $ZSH is not writable
...
from #2360
2014-06-04 19:37:14 +02:00
Mark Feltner
8d976e02b1
fix(tools/check_for_upgrade): Don't source profile
...
Reverts #2296 , but mostly #1883 .
There is no need to source ~/.profile when this script is read. oh-my-zsh writes no configuration data in ~/.profile.
If the user wishes to use data within ~/.profile, then they should source it in another place.
Fixes #2315
2014-05-24 19:51:08 +02:00
Adam Luikart
9590b96b3f
Write the update file even if CLOBBER
is unset.
2014-05-24 19:40:30 +02:00
Robby Russell
a38af27991
Revert "Cancel update if the current user doesn't have write permissions for the oh-my-zsh directory."
...
This reverts commit 152e1e07e0
.
2013-12-18 17:03:33 -08:00
n.st
152e1e07e0
Cancel update if the current user doesn't have write permissions for the oh-my-zsh directory.
2013-12-18 18:27:20 +01:00
Patrick Stadler
858c515df2
source ~/.profile only if it exists
2013-12-03 09:52:51 +01:00
Gaetan Semet
3f44f51e9c
source ~/.profile for upgrading (to source the proxy configuration)
...
Signed-off-by: Gaetan Semet <gaetan@xeberon.net>
2013-06-11 14:51:26 +02:00
Eric Danielson
200a25818a
Add UPDATE_ZSH_DAYS setting
2012-11-26 11:35:16 -08:00