fix(kit): preserve source data before creation

This commit is contained in:
2026-08-28 09:32:55 +02:00
parent ec2aa3401f
commit f99651f65e

View File

@@ -155,16 +155,6 @@ main() {
done
fi
printf 'Creating Docker sbx image: %s\n' "$new_sandbox_name"
if ! sbx create opencode \
--name "$new_sandbox_name" \
--kit "$KIT_PATH" \
--template "$TEMPLATE" \
"${workspace_paths[@]}"; then
printf 'Unable to create Docker sbx image: %s\n' "$new_sandbox_name" >&2
exit 1
fi
local tmp='' api_key
if [[ "$build_from_scratch" == false ]]; then
tmp=$(mktemp -d) || {
@@ -178,7 +168,19 @@ main() {
"$selected_sandbox" >&2
exit 1
fi
fi
printf 'Creating Docker sbx image: %s\n' "$new_sandbox_name"
if ! sbx create opencode \
--name "$new_sandbox_name" \
--kit "$KIT_PATH" \
--template "$TEMPLATE" \
"${workspace_paths[@]}"; then
printf 'Unable to create Docker sbx image: %s\n' "$new_sandbox_name" >&2
exit 1
fi
if [[ "$build_from_scratch" == false ]]; then
if ! sbx cp "$tmp/.local" "${new_sandbox_name}:/home/agent/"; then
printf 'Unable to copy the temporary .local directory into Docker sbx image: %s\n' \
"$new_sandbox_name" >&2