fix(functions): use cp --update=none instead of non-portable -n
GNU cp warns that -n's behavior is non-portable and may change; the long form is stable and silences the CI warning.
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
# having no backup at all.
|
||||
#
|
||||
# When <link> is an existing real directory, its contents are copied into
|
||||
# <target> without clobbering (cp -n) before the directory is replaced by
|
||||
# <target> without clobbering (cp --update=none) before the directory is replaced by
|
||||
# the link, so adopting a populated live directory never overwrites the
|
||||
# copy already in the vault.
|
||||
#
|
||||
@@ -60,7 +60,7 @@ function _agents_repo_ensure_symlink --argument-names link target
|
||||
else if test -d "$link"
|
||||
set -l contents (command ls -A "$link" 2>/dev/null)
|
||||
if test (count $contents) -gt 0
|
||||
command cp -rn "$link/." "$target/"; or return 1
|
||||
command cp -r --update=none "$link/." "$target/"; or return 1
|
||||
end
|
||||
rm -rf "$link"; or return 1
|
||||
else if test -e "$link"
|
||||
|
||||
@@ -354,7 +354,7 @@ function agents-init --description 'scaffold AGENTS/ sub-repo with agent spec fi
|
||||
set -l rel (string replace "$root/" "" "$src")
|
||||
set -l contents (command ls -A "$src" 2>/dev/null)
|
||||
if test (count $contents) -gt 0
|
||||
if not command cp -rn "$src/." "$canonical/"
|
||||
if not command cp -r --update=none "$src/." "$canonical/"
|
||||
echo "$c_err""Error: could not merge $rel → AGENTS/$tgt$c_reset" >&2
|
||||
return 1
|
||||
end
|
||||
@@ -437,7 +437,7 @@ function agents-init --description 'scaffold AGENTS/ sub-repo with agent spec fi
|
||||
test -d "$devlogs_dir"; or mkdir -p "$devlogs_dir"
|
||||
set -l contents (command ls -A "$docs_devlogs" 2>/dev/null)
|
||||
if test (count $contents) -gt 0
|
||||
if not command cp -rn "$docs_devlogs/." "$devlogs_dir/"
|
||||
if not command cp -r --update=none "$docs_devlogs/." "$devlogs_dir/"
|
||||
echo "$c_err""Error: could not copy docs/devlogs → AGENTS/devlogs$c_reset" >&2
|
||||
return 1
|
||||
end
|
||||
|
||||
@@ -893,7 +893,7 @@ function agents-vault --description 'track curated agent memory in a host-scoped
|
||||
if test -n "$stash"
|
||||
test -f "$stash/origin"
|
||||
and command cat "$stash/origin" >>"$entry/origin" 2>/dev/null
|
||||
command cp -rn "$stash/." "$entry/" 2>/dev/null
|
||||
command cp -r --update=none "$stash/." "$entry/" 2>/dev/null
|
||||
rm -rf "$stash"
|
||||
end
|
||||
printf 'renamed: %s → %s (%s)\n' "$prev_slug" "$slug" (date -I) >>"$entry/origin"
|
||||
|
||||
Reference in New Issue
Block a user