• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

lightninglabs / taproot-assets / 11789125409

12 Nov 2024 01:38AM UTC coverage: 40.658%. Remained the same
11789125409

Pull #1187

github

Roasbeef
scripts: use `trap` to make sure old files always restored

In this commit, we fix an issue I observed on my machine after updating
many command line/dev utilities.

I observed that if the script failed for w/e reason, then the old files
weren't properly restored.

The repro on my machine is something like:
  1. Shutdown docker, make sure the daemon isn't accessible.
  2. Run `mac sqlc`. The script should fail.
  3. Observe that the files in your local working tree are still
     altered.

We fix this by using the `trap` command, [which is basically like Go's
`defer`, but for bash
scripts](https://tldp.org/LDP/Bash-Beginners-Guide/html/sect_12_02.html)!
Pull Request #1187: scripts: use `trap` to make sure old files always restored

24691 of 60728 relevant lines covered (40.66%)

57631.25 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

84.43
/commitment/tap.go


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc