3f8ea81b89cda583acea098c9b7353c295619d4d

Author
ohmyzsh[bot] <54982679+ohmyzsh[bot]@users.noreply.github.com>
Committer
GitHub <noreply@github.com>
Date

Message

feat(z): update to cf9225fe (#13115)

Co-authored-by: ohmyzsh[bot] <54982679+ohmyzsh[bot]@users.noreply.github.com>

Diff

 1diff --git a/.github/dependencies.yml b/.github/dependencies.yml
 2index 70f3d03da646fdb74952623f0adc6e871ade85ef..23168b91ac0ad61cc9c27f9e603458aadbf7976b 100644
 3--- a/.github/dependencies.yml
 4+++ b/.github/dependencies.yml
 5@@ -38,7 +38,7 @@ dependencies:
 6   plugins/z:
 7     branch: master
 8     repo: agkozak/zsh-z
 9-    version: dd94ef04acc41748ba171eb219971cb455e0040b
10+    version: cf9225feebfae55e557e103e95ce20eca5eff270
11     precopy: |
12       set -e
13       test -e README.md && mv -f README.md MANUAL.md
14diff --git a/plugins/z/LICENSE b/plugins/z/LICENSE
15index 162cba8d1acdcce55a10566a9fa5e7d1d1b4935f..b36aeb40845a699bc358a3cdcc9d1ab079d99a6b 100644
16--- a/plugins/z/LICENSE
17+++ b/plugins/z/LICENSE
18@@ -1,6 +1,6 @@
19 MIT License
20 
21-Copyright (c) 2018-2024 Alexandros Kozak
22+Copyright (c) 2018-2025 Alexandros Kozak
23 
24 Permission is hereby granted, free of charge, to any person obtaining a copy
25 of this software and associated documentation files (the "Software"), to deal
26diff --git a/plugins/z/z.plugin.zsh b/plugins/z/z.plugin.zsh
27index bf15b01def056431249185953130774b2c592811..39b832292eb887627fc53c21f46399d0ae9d81e9 100644
28--- a/plugins/z/z.plugin.zsh
29+++ b/plugins/z/z.plugin.zsh
30@@ -4,7 +4,7 @@
31 #
32 # https://github.com/agkozak/zsh-z
33 #
34-# Copyright (c) 2018-2024 Alexandros Kozak
35+# Copyright (c) 2018-2025 Alexandros Kozak
36 #
37 # Permission is hereby granted, free of charge, to any person obtaining a copy
38 # of this software and associated documentation files (the "Software"), to deal
39@@ -294,7 +294,16 @@ zshz() {
40     owner=${ZSHZ_OWNER:-${_Z_OWNER}}
41 
42     if (( ZSHZ[USE_FLOCK] )); then
43-      ${ZSHZ[MV]} "$tempfile" "$datafile" 2> /dev/null || ${ZSHZ[RM]} -f "$tempfile"
44+      # An unsual case: if inside Docker container where datafile could be bind
45+      # mounted
46+      if [[ -r '/proc/1/cgroup' && "$(< '/proc/1/cgroup')" == *docker* ]]; then
47+        print "$(< "$tempfile")" > "$datafile" 2> /dev/null
48+        ${ZSHZ[RM]} -f "$tempfile"
49+      # All other cases
50+      else
51+        ${ZSHZ[MV]} "$tempfile" "$datafile" 2> /dev/null ||
52+            ${ZSHZ[RM]} -f "$tempfile"
53+      fi
54 
55       if [[ -n $owner ]]; then
56         ${ZSHZ[CHOWN]} ${owner}:"$(id -ng ${owner})" "$datafile"