Hangul Blocks

Hand-edit a generated file and it disappears on the next build

Two changes I made by hand to the output index.html vanished without a trace in the next build.

Hangul Blocks' index.html isn't a file I write by hand. A Python script generates it by stitching together the pieces under build-src/.

What happened

While working on something else, I opened the output index.html directly and fixed two things.

  • Show the letter name on blocks and cards
  • Let bars with no final consonant drop all the way down to the final-consonant slot

A few hours later, I re-ran the build for a different fix — and both changes quietly disappeared. They were missing from the first APK I built in between, too.

Rules going forward

  1. Never edit the output directly. If something needs fixing, fix the source pieces.
  2. Before building, diff the previous build output against the current index.html to check first whether anyone touched the output.
  3. Put a "this file is generated" comment at the top of the output.

It's painfully obvious, but if you run several tasks at once, you'll step on this mine at least once.

The app in this postHangul BlocksA Hangul Tetris where you stack colored bars to build letters
Try the demo