@@ -85,13 +85,20 @@ func processContextPaths(workDir string, paths []string) string {
85 // Expand ~ and environment variables before processing
85 // Expand ~ and environment variables before processing
86 p = expandPath(p)
86 p = expandPath(p)
88− if strings.HasSuffix(p, "/") {
89− // Use absolute path if provided, otherwise join with workDir
88+ // Use absolute path if provided, otherwise join with workDir
90− dirPath := p
89+ fullPath := p
91− if !filepath.IsAbs(p) {
90+ if !filepath.IsAbs(p) {
92− dirPath = filepath.Join(workDir, p)
91+ fullPath = filepath.Join(workDir, p)
94+ // Check if the path is a directory using os.Stat
95+ info, err := os.Stat(fullPath)
97+ return // Skip if path doesn't exist or can't be accessed
94− filepath.WalkDir(dirPath, func(path string, d os.DirEntry, err error) error {
101+ filepath.WalkDir(fullPath, func(path string, d os.DirEntry, err error) error {
95 if err != nil {
102 if err != nil {
96 return err
103 return err
@@ -115,13 +122,7 @@ func processContextPaths(workDir string, paths []string) string {
115 return nil
122 return nil
118− // Expand ~ and environment variables before processing
125+ // It's a file, process it directly
119− // Use absolute path if provided, otherwise join with workDir
121− if !filepath.IsAbs(p) {
122− fullPath = filepath.Join(workDir, p)
125 // Check if we've already processed this file (case-insensitive)
126 // Check if we've already processed this file (case-insensitive)
126 lowerPath := strings.ToLower(fullPath)
127 lowerPath := strings.ToLower(fullPath)