Commit 8882d95
committed
Fix: Version drift - Create single source of truth for version number
ISSUE:
- Script had 4 different hardcoded version strings out of sync
- Header comment: 1.0.59 (correct)
- Banner: 1.0.58 (wrong)
- JSON output: 1.0.58 (wrong)
- Log file: 1.0.58 (wrong)
- This caused incorrect version reporting in logs and JSON
ROOT CAUSE:
- Version number was hardcoded in 4 different locations
- No single source of truth for version number
- Easy to forget to update all locations when bumping version
FIX:
- Created SCRIPT_VERSION='1.0.59' constant at line 50
- Added prominent comment block explaining this is the ONLY place
to update version number
- Replaced all 3 hardcoded version strings with $SCRIPT_VERSION:
* Line 415: Log file version
* Line 608: JSON output version
* Line 1216: Banner version
- Header comment (line 4) kept for documentation
IMPACT:
- Version now displays consistently: 1.0.59 everywhere
- Future version bumps: only update ONE line (line 50)
- Prevents version drift from ever happening again
- Verified in banner, logs, and JSON output
TESTING:
- Ran script with --format json: version shows 1.0.59 ✓
- Ran script with --format text: banner shows v1.0.59 ✓
- Checked log file: Script Version shows 1.0.59 ✓1 parent 720edf2 commit 8882d95
3 files changed
Lines changed: 23 additions & 3 deletions
File renamed without changes.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
11 | 23 | | |
12 | 24 | | |
13 | 25 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
44 | 52 | | |
45 | 53 | | |
46 | 54 | | |
| |||
404 | 412 | | |
405 | 413 | | |
406 | 414 | | |
407 | | - | |
| 415 | + | |
408 | 416 | | |
409 | 417 | | |
410 | 418 | | |
| |||
597 | 605 | | |
598 | 606 | | |
599 | 607 | | |
600 | | - | |
| 608 | + | |
601 | 609 | | |
602 | 610 | | |
603 | 611 | | |
| |||
1205 | 1213 | | |
1206 | 1214 | | |
1207 | 1215 | | |
1208 | | - | |
| 1216 | + | |
1209 | 1217 | | |
1210 | 1218 | | |
1211 | 1219 | | |
| |||
0 commit comments