Skip to content

Commit

Permalink
Merge pull request #264 from simulot:simulot/issue261
Browse files Browse the repository at this point in the history
Fallback to no-gui mode when the UI can't be created
  • Loading branch information
simulot authored May 27, 2024
2 parents 11cfe5f + 6a4fdaa commit 1007705
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cmd/upload/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"sync"
"time"

"github.com/gdamore/tcell/v2"
"github.com/google/uuid"
"github.com/simulot/immich-go/browser"
"github.com/simulot/immich-go/browser/files"
Expand Down Expand Up @@ -210,6 +211,13 @@ func (app *UpCmd) run(ctx context.Context) error {
if app.NoUI {
return app.runNoUI(ctx)
}

_, err = tcell.NewScreen()
if err != nil {
app.Log.Error("can't initialize the screen for the UI mode. Falling back to no-gui mode")
fmt.Println("can't initialize the screen for the UI mode. Falling back to no-gui mode")
return app.runNoUI(ctx)
}
return app.runUI(ctx)
}

Expand Down

0 comments on commit 1007705

Please sign in to comment.