Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cmd_install.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
"context"
"errors"
"fmt"
"os"
"path/filepath"
Expand Down Expand Up @@ -149,7 +150,7 @@ the latest version for the current OS will be used.`,
err = downloader.Download(cmd.Context(), installPath, nil, nil)

// Check if download was cancelled (Ctrl+C)
if err == context.Canceled {
if errors.Is(err, context.Canceled) {
return nil // Exit cleanly without error
}

Expand Down
3 changes: 2 additions & 1 deletion cmd_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
"context"
"errors"
"fmt"

"github.com/gustash/freecarnival/auth"
Expand Down Expand Up @@ -104,7 +105,7 @@ func newUpdateCmd() *cobra.Command {
err = updater.Update(cmd.Context())

// Check if update was cancelled (Ctrl+C)
if err == context.Canceled {
if errors.Is(err, context.Canceled) {
return nil // Exit cleanly without error
}

Expand Down
5 changes: 3 additions & 2 deletions download/downloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package download

import (
"context"
"errors"
"fmt"
"net/http"
"os"
Expand Down Expand Up @@ -153,7 +154,7 @@ func (d *Downloader) Download(ctx context.Context, installPath string, buildMani

err = d.downloadAndWrite(ctx, fileChunks, fileInfoMap, resumeState)

if ctx.Err() == context.Canceled {
if errors.Is(ctx.Err(), context.Canceled) {
d.progress.Abort()
logger.Info("\n\nDownload paused. Progress has been saved.")
logger.Info("Run the same install command again to resume from where you left off.")
Expand Down Expand Up @@ -457,7 +458,7 @@ func (d *Downloader) downloadWorker(ctx context.Context, downloader *ChunkDownlo

data, err := downloader.Download(ctx, job.FileIndex, job.ChunkSHA)

if err == context.Canceled {
if errors.Is(err, context.Canceled) {
d.memory.Release(manifest.MaxChunkSize)
return
}
Expand Down
Loading