mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-05-07 17:31:04 +00:00
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 <refactor@openrouter.ai> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
b0843f6144
commit
f871996a82
1 changed files with 6 additions and 1 deletions
|
|
@ -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}"
|
||||
}
|
||||
|
||||
# ============================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue