From 5bf8ae757efc5661fbfc554c3641139f1aa41bc8 Mon Sep 17 00:00:00 2001 From: Chris La Date: Tue, 17 Mar 2026 08:34:56 -0700 Subject: [PATCH] Fix install.sh error when cwd equals INSTALL_DIR When strawhub runs install.sh, it sets cwd to the package directory which is the same as INSTALL_DIR. The mv command fails with "'binary' and 'target/binary' are the same file". Skip the mv when source and destination resolve to the same absolute path. Co-Authored-By: Claude Opus 4.6 --- strawpot_codex/install.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/strawpot_codex/install.sh b/strawpot_codex/install.sh index 2546356..432f35a 100644 --- a/strawpot_codex/install.sh +++ b/strawpot_codex/install.sh @@ -43,7 +43,12 @@ chmod +x "${BINARY_NAME}" mkdir -p "$INSTALL_DIR" if [ -w "$INSTALL_DIR" ]; then - mv "${BINARY_NAME}" "${INSTALL_DIR}/${BINARY_NAME}" + # Skip mv when already downloaded into the install directory (e.g. strawhub sets cwd = INSTALL_DIR) + SRC="$(cd "$(dirname "${BINARY_NAME}")" && pwd)/$(basename "${BINARY_NAME}")" + DST="$(cd "$INSTALL_DIR" && pwd)/${BINARY_NAME}" + if [ "$SRC" != "$DST" ]; then + mv "${BINARY_NAME}" "${INSTALL_DIR}/${BINARY_NAME}" + fi else echo "Error: cannot write to ${INSTALL_DIR}" >&2 exit 1