Skip to content

Commit e94fe51

Browse files
committed
feat: add snapshot check using the release version
1 parent 4c44920 commit e94fe51

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

cmd/auto-update/main.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
"os/signal"
1717
"path/filepath"
1818
"runtime"
19+
"strings"
1920
"sync"
2021
"sync/atomic"
2122
"syscall"
@@ -63,10 +64,6 @@ var (
6364
1: "http://canopy-mainnet-latest-chain-id1.us.nodefleet.net",
6465
2: "http://canopy-mainnet-latest-chain-id2.us.nodefleet.net",
6566
}
66-
// snapshotVersion dictates which versions should download a new snahpshot
67-
snapshotVersion = map[string]struct{}{
68-
"beta-0.1.12": {},
69-
}
7067
)
7168

7269
// Release represents a GitHub release with all its associated metadata
@@ -200,7 +197,7 @@ func HandleUpdateCheck() {
200197
// check whether the new version requires a snapshot update
201198
var snapshotPath string
202199
var snapshotErr error
203-
if _, ok := snapshotVersion[curRelease]; ok {
200+
if applySnapshot := strings.Contains(version, "snapshot"); applySnapshot {
204201
log.Printf("New version %s requires snapshot update, installing...", curRelease)
205202
snapshotPath, snapshotErr = HandleNewSnapshot(config)
206203
if snapshotErr != nil {

0 commit comments

Comments
 (0)