1
0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-11-22 07:12:13 +08:00
Commit Graph

70 Commits

Author SHA1 Message Date
Marc Cornellà
80a651a6df
chore(updater): small typo 2024-04-18 07:48:33 +02:00
Marc Cornellà
56cfcb44e7
fix(updater): abort update if $ZSH is not a git repository
Fixes #12298
2024-04-18 07:33:13 +02:00
Marc Cornellà
29b99c2c7b
feat(updater): add background-alpha update mode (preview) (#11928)
NOTE: this feature is in alpha / preview mode, it is not guaranteed to work 100% of the
time in all cases. If you experience any issues, open an issue or search for an open
one describing your same situation.

To use this, use the zstyle update mode settings [1] with the value `background-alpha`:

  zstyle ':omz:update' mode background-alpha

[1] https://github.com/ohmyzsh/ohmyzsh#getting-updates
2023-10-09 18:00:17 +02:00
Carlo Sala
d889eca726
fix(check_for_upgrade): update properly LAST_EPOCH
Fixes #11617
2023-04-17 20:09:30 +02:00
Håvard Bartnes
8f6fbe2389
feat(upgrade): add verbosity settings
Co-authored-by: Carlo Sala <carlosalag@protonmail.com>

Closes #11574
Closes #11579
2023-03-28 12:58:33 +02:00
Carlo Sala
fe0dd8226d fix(upgrade): do not upgrade if not called from tty
Fixes #11390
2023-01-17 12:48:05 +01:00
Carlo Sala
3fca9c8933
fix(upgrade): check if git is available and working
macOS seems to break dev tools when updating the system. This should
prevent the previous issues. See #11309

Closes #11420
2023-01-03 10:02:05 +01:00
Brian Wright
bb6c14cdfd
fix(updater): correct spelling of curl flag (#11072) 2022-07-26 11:46:10 +02:00
Marc Cornellà
18e7e5d033
fix(updater): use curl --connect-timeout in new update check 2022-06-01 09:11:49 +02:00
Marc Cornellà
846f417eb8
feat(updater): check for typed input before automatically updating (#10830) 2022-04-10 10:20:51 +02:00
SBado
af0c3b64b8
fix(updater): prefix cd with builtin when it is aliased (#10753) 2022-03-04 16:54:51 +01:00
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