Commit 493769a
committed
fix: parse
The `parseGoVersionFile` function used to only
check for exact filenames like "go.{mod,work}".
When `go-version-file` pointed to something like a
tools modfile ("go.tool.mod"), it would just dump
the whole file contents back, which then got
mistaken for a version spec and broke the
manifest/dist resolution.
Now it looks at the file content to spot Go module
or workspace files and pulls out the `toolchain`
or `go` directives. Left ".tool-versions" handling
alone.
Fixes #746
Signed-off-by: Dwi Siswanto <git@dw1.io>go-version-file by content1 parent 4a36011 commit 493769a
File tree
4 files changed
+60
-20
lines changed- __tests__
- dist/setup
- docs
- src
4 files changed
+60
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
901 | 901 | | |
902 | 902 | | |
903 | 903 | | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
904 | 916 | | |
905 | 917 | | |
906 | 918 | | |
| |||
1066 | 1078 | | |
1067 | 1079 | | |
1068 | 1080 | | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
1069 | 1094 | | |
1070 | 1095 | | |
1071 | 1096 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77493 | 77493 | | |
77494 | 77494 | | |
77495 | 77495 | | |
| 77496 | + | |
| 77497 | + | |
| 77498 | + | |
| 77499 | + | |
77496 | 77500 | | |
77497 | | - | |
77498 | | - | |
| 77501 | + | |
| 77502 | + | |
| 77503 | + | |
| 77504 | + | |
| 77505 | + | |
| 77506 | + | |
| 77507 | + | |
| 77508 | + | |
| 77509 | + | |
77499 | 77510 | | |
77500 | 77511 | | |
77501 | 77512 | | |
77502 | 77513 | | |
77503 | | - | |
| 77514 | + | |
77504 | 77515 | | |
77505 | 77516 | | |
77506 | 77517 | | |
77507 | 77518 | | |
77508 | 77519 | | |
77509 | | - | |
| 77520 | + | |
77510 | 77521 | | |
77511 | 77522 | | |
77512 | | - | |
77513 | | - | |
77514 | | - | |
77515 | | - | |
77516 | 77523 | | |
77517 | 77524 | | |
77518 | 77525 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
167 | | - | |
| 167 | + | |
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
651 | 651 | | |
652 | 652 | | |
653 | 653 | | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
654 | 659 | | |
| 660 | + | |
655 | 661 | | |
656 | | - | |
657 | | - | |
658 | | - | |
659 | | - | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
660 | 673 | | |
661 | 674 | | |
662 | 675 | | |
663 | 676 | | |
664 | | - | |
665 | | - | |
666 | | - | |
| 677 | + | |
667 | 678 | | |
668 | 679 | | |
669 | 680 | | |
670 | 681 | | |
671 | 682 | | |
672 | 683 | | |
673 | | - | |
| 684 | + | |
674 | 685 | | |
675 | | - | |
676 | | - | |
677 | | - | |
678 | 686 | | |
679 | 687 | | |
680 | 688 | | |
| |||
0 commit comments