Skip to content
Draft
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
22 changes: 22 additions & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package cmd

import (
"fmt"
"log"
"os"
"path/filepath"

Expand Down Expand Up @@ -53,6 +54,27 @@ across multiple machines with version control integration.`,
cmd.Help()
os.Exit(1)
}
if len(args) > 0 {
if args[0] == "." {
rootDir := args[0]
err := filepath.Walk(rootDir, func(path string, info os.FileInfo, err error) error {
if err != nil {
// Handle errors that occurred during traversal (e.g., permission denied)
fmt.Printf("Error accessing path %s: %v\n", path, err)
return nil // Continue walking the tree despite the error
}

if info.IsDir() {
// fmt.Println(path) // Print the path of the discovered directory
config.Packages = append(config.Packages, path)
}
return nil
})
if err != nil {
log.Fatalf("Error walking the directory tree: %v", err)
}
}
}

// Convert to absolute paths
var err error
Expand Down