(Fix): Removed unneccessary comments that my copilot generated.
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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)))
|
||||
|
||||
Reference in New Issue
Block a user