(Fix): Removed unneccessary comments that my copilot generated.

This commit is contained in:
2025-11-22 10:17:28 +00:00
parent 8081085f87
commit 3caca0dfcb
8 changed files with 3 additions and 46 deletions

View File

@@ -12,7 +12,6 @@ func getPathCompletions(input string) []string {
input = "."
}
// Expand home directory
if strings.HasPrefix(input, "~") {
home, err := os.UserHomeDir()
if err == nil {
@@ -20,20 +19,16 @@ func getPathCompletions(input string) []string {
}
}
// Get the directory and file pattern
dir := filepath.Dir(input)
pattern := filepath.Base(input)
// If input ends with /, we want to list that directory
if strings.HasSuffix(input, string(filepath.Separator)) {
dir = input
pattern = ""
}
// Read directory
entries, err := os.ReadDir(dir)
if err != nil {
// If can't read, try current directory
entries, err = os.ReadDir(".")
if err != nil {
return []string{}
@@ -63,7 +58,6 @@ func getPathCompletions(input string) []string {
completions = append(completions, fullPath)
}
// Limit to 15 suggestions
if len(completions) > 15 {
completions = completions[:15]
}
@@ -85,13 +79,11 @@ func getArchiveCompletions(input string) []string {
archiveCompletions := []string{}
for _, path := range allCompletions {
// Keep directories
if strings.HasSuffix(path, string(filepath.Separator)) {
archiveCompletions = append(archiveCompletions, path)
continue
}
// Check if file has archive extension
ext := filepath.Ext(path)
if archiveExts[ext] {
archiveCompletions = append(archiveCompletions, path)

View File

@@ -228,7 +228,6 @@ func RunBatchExtractFlow() error {
fmt.Println(InfoStyle.Render(fmt.Sprintf("📂 Batch extracting %d archives...", len(configs))))
fmt.Println()
// Create batch config
batchConfig := &archiver.BatchExtractConfig{
Configs: configs,
Parallel: parallel,
@@ -246,7 +245,6 @@ func RunBatchExtractFlow() error {
errors := archiver.BatchExtract(batchConfig)
// Count successes
successCount := 0
for _, err := range errors {
if err == nil {

View File

@@ -21,7 +21,6 @@ func RunCompressFlow() error {
var verify bool
var compressionLevel string
// Get current working directory
cwd, _ := os.Getwd()
form := huh.NewForm(
@@ -124,14 +123,11 @@ func RunCompressFlow() error {
}
}
// Auto-generate output path if not provided
if outputPath == "" {
sourceName := filepath.Base(sourcePath)
// Remove trailing slashes
sourceName = strings.TrimSuffix(sourceName, string(filepath.Separator))
// Determine file extension based on archive type
var extension string
switch models.ArchiveType(archiveTypeStr) {
case models.ZIP:
@@ -146,7 +142,6 @@ func RunCompressFlow() error {
extension = ".zip"
}
// Create output path in current working directory
outputPath = filepath.Join(cwd, sourceName+extension)
fmt.Println(InfoStyle.Render(fmt.Sprintf("📝 Auto-generated output: %s", outputPath)))