File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -111,6 +111,19 @@ TEMPLATES_DIR="${TEMPLATES_DIR:-../cre-templates}"
111111# 1. Build
112112
113113info " Building SDK..."
114+
115+ # Back up the compiled wasm artifact before the build overwrites it.
116+ # Using a file backup (not git restore) so we restore whatever state the
117+ # developer had — including uncommitted changes — not just the last commit.
118+ # IMPORTANT: the backup must live outside the dist/ directory because the
119+ # build's clean step runs `rm -rf dist`, which would delete an in-place backup.
120+ WASM_FILE=" $MONOREPO_ROOT /packages/cre-sdk-javy-plugin/dist/javy-chainlink-sdk.plugin.wasm"
121+ if [ -f " $WASM_FILE " ]; then
122+ WASM_BACKUP=$( mktemp)
123+ cp " $WASM_FILE " " $WASM_BACKUP "
124+ LOCKFILE_BACKUPS+=(" $WASM_BACKUP :$WASM_FILE " )
125+ fi
126+
114127_build_out=" "
115128if ! run_captured _build_out bun run build; then
116129 info " ❌ SDK build failed."
You can’t perform that action at this time.
0 commit comments