getDotFolderExcludes returns the subset of excludeFiles that are top-level dot-folder path prefixes (i.e. start with "." and end with "/"). These are used at compile time to tell the runtime handler which specific dot-folders have been opted out of the general top-level-dot-folder protection.
(excludeFiles []string)
| 268 | // These are used at compile time to tell the runtime handler which specific |
| 269 | // dot-folders have been opted out of the general top-level-dot-folder protection. |
| 270 | func getDotFolderExcludes(excludeFiles []string) []string { |
| 271 | var result []string |
| 272 | for _, f := range excludeFiles { |
| 273 | // Must start with ".", end with "/", and have at least one char between |
| 274 | // them (e.g. ".agents/" is valid; "./" is not). |
| 275 | if len(f) > 2 && f[0] == '.' && f[len(f)-1] == '/' { |
| 276 | result = append(result, f) |
| 277 | } |
| 278 | } |
| 279 | return result |
| 280 | } |
| 281 | |
| 282 | // findRuntimeByID finds a runtime configuration by its ID |
| 283 | func findRuntimeByID(id string) *Runtime { |
no outgoing calls