Skip to content

Commit 305db48

Browse files
committed
chore: don't run stuff twice
1 parent b59ec75 commit 305db48

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

cmd/serve.go

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -385,15 +385,19 @@ func initScroll(scrollService *services.ScrollService, snapshotService ports.Sna
385385
if err != nil {
386386
return false, err
387387
}
388+
389+
newScroll = len(lock.Statuses) == 0
388390
}
389391

390-
logger.Log().Info("No lock file found, but init command available. Bootstrapping...")
392+
if newScroll {
393+
logger.Log().Info("No lock file found, but init command available. Bootstrapping...")
391394

392-
logger.Log().Info("Creating lock and bootstrapping files")
393-
//There is an error here. We need to bootstrap the files before we render out the templates in the bootstrap func above
394-
err := scrollService.CreateLockAndBootstrapFiles()
395-
if err != nil {
396-
return newScroll, err
395+
logger.Log().Info("Creating lock and bootstrapping files")
396+
//There is an error here. We need to bootstrap the files before we render out the templates in the bootstrap func above
397+
err := scrollService.CreateLockAndBootstrapFiles()
398+
if err != nil {
399+
return newScroll, err
400+
}
397401
}
398402
} else {
399403
logger.Log().Info("Found lock file, bootstrapping done")

0 commit comments

Comments
 (0)