The error is coming from the self-relocation guard at the top of the script. Here's the relevant section:
if [ -z "$_ACP_UPDATE_RELOCATED" ]; then
_tmp_copy=$(mktemp)
cp "$0" "$_tmp_copy" # <-- THIS is failing
...
fi
When you pipe a script directly into bash via curl ... | bash, $0 is set to bash (or sometimes stdin), not a real file path. So cp "bash" "$_tmp_copy" fails because there's no file called bash to copy.
The script is designed to copy itself to a temp file before executing (so it can safely overwrite itself during the update), but that pattern only works when the script is run as an actual file on disk, not piped in.
The fix — save it to a file first, then run it:
curl -fsSL https://raw.githubusercontent.com/prmichaelsen/agent-context-protocol/mainline/agent/scripts/acp.version-update.sh -o acp.version-update.sh
chmod +x acp.version-update.sh
bash acp.version-update.sh
Or if you already have it in agent/scripts/:
bash agent/scripts/acp.version-update.sh
Running it as a real file gives $0 a valid path, so cp "$0" works correctly.
====
That fixed it for me.
The error is coming from the self-relocation guard at the top of the script. Here's the relevant section:
if [ -z "$_ACP_UPDATE_RELOCATED" ]; then
_tmp_copy=$(mktemp)
cp "$0" "$_tmp_copy" # <-- THIS is failing
...
fi
When you pipe a script directly into bash via curl ... | bash, $0 is set to bash (or sometimes stdin), not a real file path. So cp "bash" "$_tmp_copy" fails because there's no file called bash to copy.
The script is designed to copy itself to a temp file before executing (so it can safely overwrite itself during the update), but that pattern only works when the script is run as an actual file on disk, not piped in.
The fix — save it to a file first, then run it:
curl -fsSL https://raw.githubusercontent.com/prmichaelsen/agent-context-protocol/mainline/agent/scripts/acp.version-update.sh -o acp.version-update.sh
chmod +x acp.version-update.sh
bash acp.version-update.sh
Or if you already have it in agent/scripts/:
bash agent/scripts/acp.version-update.sh
Running it as a real file gives $0 a valid path, so cp "$0" works correctly.
====
That fixed it for me.