From f871996a821265fe25f06b07edaae5cadebac669 Mon Sep 17 00:00:00 2001 From: A <258483684+la14-1@users.noreply.github.com> Date: Sat, 14 Feb 2026 13:10:17 -0800 Subject: [PATCH] ux: create parent directories before moving config files (#1127) Fixes #1125 and #1114 The upload_config_file() function now creates parent directories before moving config files to paths like ~/.claude/settings.json and ~/.openclaw/openclaw.json. Previously, if these directories didn't exist, the mv command would fail with "No such file or directory" errors. This affected all agents using setup_claude_code_config() and setup_openclaw_config(). Changes: - Extract directory path using dirname - Create parent directories with mkdir -p - Execute chmod and mv in same command chain Agent: ux-engineer Co-authored-by: spawn-refactor-bot Co-authored-by: Claude Sonnet 4.5 --- shared/common.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/shared/common.sh b/shared/common.sh index f49bcfc4..5581e3a4 100644 --- a/shared/common.sh +++ b/shared/common.sh @@ -2327,7 +2327,12 @@ upload_config_file() { rand_suffix=$(basename "${temp_file}") local temp_remote="/tmp/spawn_config_${rand_suffix}" ${upload_callback} "${temp_file}" "${temp_remote}" - ${run_callback} "chmod 600 '${temp_remote}' && mv '${temp_remote}' '${remote_path}'" + + # Extract directory path and create parent directories if needed + # This handles paths like ~/.claude/settings.json or ~/.openclaw/openclaw.json + local dir_cmd + dir_cmd="parent_dir=\$(dirname '${remote_path}') && mkdir -p \"\${parent_dir}\" && chmod 600 '${temp_remote}' && mv '${temp_remote}' '${remote_path}'" + ${run_callback} "${dir_cmd}" } # ============================================================