Commit 00ef50d
authored
fix(core): pressing Ctrl-C when content is bundled leaves broken asset (#33692)
When a bundling command is interrupted with Ctrl-C, the asset output directory has already been created. On the next synthesis, we assume the asset has already successfully been produced, don't do any bundling, and upload it.
We will then have produced and uploaded a broken asset.
Instead, the common pattern to handle this is:
- Do the work into a temporary directory
- Rename the temporary directory to the target directory only if the work succeeds.
Closes #33201, closes #32869, relates to #14474.
----
*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*1 parent 4ab0b33 commit 00ef50d
File tree
5 files changed
+85
-20
lines changed- packages/aws-cdk-lib/core
- lib
- test
5 files changed
+85
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
438 | 438 | | |
439 | 439 | | |
440 | 440 | | |
441 | | - | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
442 | 446 | | |
443 | | - | |
| 447 | + | |
444 | 448 | | |
445 | 449 | | |
446 | 450 | | |
447 | 451 | | |
448 | 452 | | |
449 | | - | |
| 453 | + | |
450 | 454 | | |
451 | 455 | | |
452 | 456 | | |
453 | | - | |
| 457 | + | |
454 | 458 | | |
455 | 459 | | |
456 | 460 | | |
| |||
464 | 468 | | |
465 | 469 | | |
466 | 470 | | |
467 | | - | |
468 | | - | |
469 | | - | |
470 | | - | |
471 | | - | |
472 | | - | |
473 | | - | |
474 | | - | |
475 | | - | |
476 | 471 | | |
477 | | - | |
478 | | - | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
479 | 476 | | |
480 | 477 | | |
481 | 478 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
57 | | - | |
58 | 56 | | |
59 | 57 | | |
60 | 58 | | |
| |||
Lines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
53 | 62 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
610 | 611 | | |
611 | 612 | | |
612 | 613 | | |
613 | | - | |
| 614 | + | |
614 | 615 | | |
615 | 616 | | |
616 | 617 | | |
617 | 618 | | |
618 | 619 | | |
619 | | - | |
| 620 | + | |
620 | 621 | | |
621 | 622 | | |
622 | 623 | | |
| |||
675 | 676 | | |
676 | 677 | | |
677 | 678 | | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
678 | 717 | | |
679 | 718 | | |
680 | 719 | | |
| |||
0 commit comments