Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 config/runtimes-installer.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,11 @@ func downloadAndExtractRuntime(runtimeInfo *plugins.RuntimeInfo) error {

if strings.HasSuffix(fileName, ".zip") {
err = utils.ExtractZip(file.Name(), runtimesDir)
} else if strings.HasSuffix(fileName, ".tar.xz") || strings.HasSuffix(fileName, ".txz") {
err = utils.ExtractTarXz(file, runtimesDir)
} else {
err = utils.ExtractTarGz(file, runtimesDir)
}

if err != nil {
return fmt.Errorf("failed to extract runtime: %w", err)
}
Expand Down
8 changes: 4 additions & 4 deletions plugins/runtimes/flutter/plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ name: flutter
description: Dart Flutterruntime
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a spelling error in the description. 'Flutterruntime' should be 'Flutter runtime' (with a space).

Copilot uses AI. Check for mistakes.
default_version: "3.7.2"
download:
url_template: "https://storage.googleapis.com/flutter_infra_release/releases/stable/{{.OS}}/flutter_{{.OS}}_{{.Arch}}_{{.Version}}-stable.{{.Extension}}"
url_template: "https://storage.googleapis.com/flutter_infra_release/releases/stable/{{.OS}}/flutter_{{.OS}}_{{.Version}}-stable.{{.Extension}}"
file_name_template: "flutter"
extension:
default: "zip"
linux: "tar.xz"
default: "zip"
arch_mapping:
"386": "ia32"
"amd64": "x64"
"386": ""
"amd64": ""
"arm": "arm"
"arm64": "arm64"
os_mapping:
Expand Down
4 changes: 4 additions & 0 deletions plugins/shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (

// ExtensionConfig defines the file extension based on OS
type ExtensionConfig struct {
Linux string `yaml:"linux"`
Windows string `yaml:"windows"`
Default string `yaml:"default"`
}
Expand Down Expand Up @@ -80,6 +81,9 @@ func GetExtension(extension ExtensionConfig, goos string) string {
if goos == "windows" {
return extension.Windows
}
if goos == "linux" {
return extension.Linux
}
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The GetExtension function should check if extension.Linux is non-empty before returning it. Currently, if a plugin.yaml has 'linux: ""' specified, it will return an empty string instead of falling back to the Default value. Consider adding a check: if goos == "linux" && extension.Linux != "" { return extension.Linux }.

Copilot uses AI. Check for mistakes.
return extension.Default
}

Expand Down
10 changes: 9 additions & 1 deletion utils/extract.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,16 @@
)

func ExtractTarGz(archive *os.File, targetDir string) error {
return ExtractTar(archive, targetDir, archiver.Gz{})
}

func ExtractTarXz(archive *os.File, targetDir string) error {

Check notice on line 20 in utils/extract.go

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

utils/extract.go#L20

exported function ExtractTarXz should have comment or be unexported
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return ExtractTar(archive, targetDir, archiver.Xz{})
}

func ExtractTar(archive *os.File, targetDir string, compression archiver.Compression) error {

Check notice on line 24 in utils/extract.go

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

utils/extract.go#L24

exported function ExtractTar should have comment or be unexported
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

format := archiver.CompressedArchive{
Compression: archiver.Gz{},
Compression: compression,
Archival: archiver.Tar{},
}

Expand Down
Loading