fix(kit): preserve source data before creation
This commit is contained in:
22
build-sbx.sh
22
build-sbx.sh
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user