File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -13,9 +13,9 @@ VALIDATOR_BINARY := validator
13
13
SIGNER_BINARY := signer
14
14
15
15
# allow custom program name
16
- LAUNCHER_PROGRAM_NAME := $(shell GO111MODULE=on go run cmd/echo_field/main.go cmd/launcher/resources/launcher-config.json BinaryName)
16
+ LAUNCHER_PROGRAM_NAME := $(shell go run cmd/echo_field/main.go cmd/launcher/resources/launcher-config.json BinaryName)
17
17
LAUNCHER_PROGRAM_EXT :=
18
- LAUNCHER_BRANDING_NAME := $(shell GO111MODULE=on go run cmd/echo_field/main.go cmd/launcher/resources/launcher-config.json BrandingName)
18
+ LAUNCHER_BRANDING_NAME := $(shell go run cmd/echo_field/main.go cmd/launcher/resources/launcher-config.json BrandingName)
19
19
MSI_PREFIX := ${LAUNCHER_PROGRAM_NAME}
20
20
21
21
GITDESC := $(shell git describe --tags 2> /dev/null || echo unavailable)
57
57
$(info Detected uname-id '${OS_UNAME}' as OS '${OS}')
58
58
59
59
# Globally enable go modules
60
- export GO111MODULE =on
61
60
export GOOS =${OS}
62
61
export LAUNCHER_PROGRAM_NAME
63
62
export LAUNCHER_PROGRAM_EXT
@@ -213,7 +212,7 @@ copy-test-files: ## Copy example resources into resource directory
213
212
cp examples/defaulticon.ico cmd/launcher/resources/icon.ico
214
213
215
214
generate : # # Run go generate
216
- GO111MODULE=off go get github.com/josephspurrier/goversioninfo/cmd/goversioninfo
215
+ go get github.com/josephspurrier/goversioninfo/cmd/goversioninfo
217
216
go generate -installsuffix _separate -ldflags ' ${LDFLAGS}' ${MODULE_PATH_LAUNCHER}
218
217
219
218
clean : # # Clean generated files
Original file line number Diff line number Diff line change @@ -18,6 +18,10 @@ type Timestamps struct {
18
18
Bundles map [string ]string `json:"Bundles"`
19
19
}
20
20
21
+ func createEmptyTimestamps () * Timestamps {
22
+ return & Timestamps {DeploymentConfig : "" , Bundles : map [string ]string {}}
23
+ }
24
+
21
25
func VerifyDeploymentConfigTimestamp (newTimestamp , filePath string ) {
22
26
timestamps := readTimestamps (filePath )
23
27
timestamps .CheckAndSetDeploymentConfigTimestamp (newTimestamp )
@@ -36,7 +40,7 @@ func readTimestamps(filePath string) *Timestamps {
36
40
if os .IsNotExist (err ) {
37
41
log .WithFields (log.Fields {"err" : err , "filePath" : filePath }).Infof ("Could not read timestamps " +
38
42
"because the file does not yet exist: looks like this is the first run of the launcher." )
39
- return & Timestamps { DeploymentConfig : "" , Bundles : map [ string ] string {}}
43
+ return createEmptyTimestamps ()
40
44
}
41
45
panic (err )
42
46
}
@@ -64,7 +68,8 @@ func ReadTimestampsFromReader(reader io.Reader) *Timestamps {
64
68
var timestamps Timestamps
65
69
err = json .Unmarshal (bytes , & timestamps )
66
70
if err != nil {
67
- panic (fmt .Sprintf ("Could not unmarshal timestamps `%s`: %v" , string (bytes ), err ))
71
+ log .Warnf ("Ignoring timestamps: Could not unmarshal timestamps `%s`: %v" , string (bytes ), err )
72
+ return createEmptyTimestamps ()
68
73
}
69
74
return & timestamps
70
75
}
You can’t perform that action at this time.
0 commit comments