all repos — website @ 3e8e5885a266e7a249855c17e35aa16f7cf011a9

My website

check for nil before overriding BASE_URL
Alan Pearce alan@alanpearce.eu
Sun, 21 Apr 2024 22:31:56 +0200
commit

3e8e5885a266e7a249855c17e35aa16f7cf011a9

parent

ffff4d09ab38e2ef3b56ee282f3cec5a558d5cc3

1 files changed, 5 insertions(+), 3 deletions(-)

jump to
M cmd/build/build.gocmd/build/build.go
@@ -566,9 +566,11 @@ if err != nil { 		log.Panic(errors.Errorf("could not get config: %v", err))
 	}
 
-	config.BaseURL.URL, err = url.Parse(ioConfig.BaseURL.String())
-	if err != nil {
-		log.Panic(errors.Errorf("highly unlikely: %v", err))
+	if ioConfig.BaseURL.URL != nil {
+		config.BaseURL.URL, err = url.Parse(ioConfig.BaseURL.String())
+		if err != nil {
+			log.Panic(errors.Errorf("highly unlikely: %v", err))
+		}
 	}
 
 	err = os.RemoveAll(ioConfig.Destination)