{"record":{"id":"4b1903a59f93b92a","repo":"JanDeDobbeleer/oh-my-posh","slug":"no-theme-files-found-in-s","errorCode":null,"errorMessage":"no theme files found in %s","messagePattern":"no theme files found in (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/config_export_data.go","lineNumber":392,"sourceCode":"// them into one fixture: for every env and segment key that appears in any\n// theme, the richest recorded value wins (mergeRichest) - not the most common\n// one. A fixture exists to exercise template logic, not to model a typical\n// machine: a theme that never enables an optional field (git fetch_status,\n// extra sysinfo fields, ...) never references it either way, so picking the\n// most populated variant costs those themes nothing and gives every other\n// theme's template more real data - ahead/behind counts, working-tree status,\n// upstream icons - to render instead of zero values. This is what lets a\n// single ~23KB fixture stand in for the 124 per-theme recordings it replaces -\n// every segment key any bundled theme uses gets a plausible, richly populated\n// value, without carrying 124 near-duplicate copies of the sparsest ones.\nfunc buildMergedDataDocument(themesDir string) ([]byte, error) {\n\tthemePaths, err := config.ThemeFiles(themesDir)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif len(themePaths) == 0 {\n\t\treturn nil, fmt.Errorf(\"no theme files found in %s\", themesDir)\n\t}\n\n\tenvValues := make(map[string][]json.RawMessage)\n\tsegmentValues := make(map[string][]json.RawMessage)\n\n\tfor _, themePath := range themePaths {\n\t\tenv, segments, err := recordThemeSanitized(themePath)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor key, value := range env {\n\t\t\tenvValues[key] = append(envValues[key], value)\n\t\t}\n\n\t\tfor key, value := range segments {\n\t\t\tsegmentValues[key] = append(segmentValues[key], value)\n\t\t}","sourceCodeStart":374,"sourceCodeEnd":410,"githubUrl":"https://github.com/JanDeDobbeleer/oh-my-posh/blob/0976794618c5ed95de0985dded50de1b4dc914cb/src/cli/config_export_data.go#L374-L410","documentation":"buildMergedDataDocument collects all theme files from the directory passed via --themes; when config.ThemeFiles returns an empty list, this error aborts the merged-fixture export because there is nothing to record. It is a plain error (no wrapped cause) naming the directory that contained no themes.","triggerScenarios":"Running `oh-my-posh config export data --themes <dir> --sanitize` where <dir> exists but contains no recognized theme files (empty dir, only non-theme files, wrong extension).","commonSituations":"Typo in the --themes path (pointing at a sibling empty directory); running from the wrong working directory with a relative path; themes directory contains only subdirectories or only files with unexpected extensions.","solutions":["Check the path in the error message and point --themes at the directory that actually contains theme files (e.g. ../themes from src/)","Verify with `ls <dir>/*.omp.*` (or your platform equivalent) that theme files with recognized extensions exist there","Use an absolute path to avoid resolving a relative path against an unexpected working directory","Confirm you did not pass a file instead of a directory"],"exampleFix":"// before\noh-my-posh config export data --themes ./themse --sanitize\n// after\noh-my-posh config export data --themes ../themes --sanitize","handlingStrategy":"validation","validationCode":"info, err := os.Stat(themesDir)\nif err != nil { return err }\nif !info.IsDir() { return fmt.Errorf(\"%s is not a directory\", themesDir) }\nentries, _ := os.ReadDir(themesDir)\nn := 0\nfor _, e := range entries {\n    if !e.IsDir() { n++ }\n}\nif n == 0 { return fmt.Errorf(\"%s contains no theme files\", themesDir) }","typeGuard":null,"tryCatchPattern":"doc, err := buildMergedDataDocument(themesDir)\nif err != nil {\n    if strings.HasPrefix(err.Error(), \"no theme files found\") {\n        return fmt.Errorf(\"check --themes path (got %q); expected a directory of theme files\", themesDir)\n    }\n    return err\n}","preventionTips":["Pass an absolute path to --themes to avoid resolving against the wrong working directory","Verify the directory contains theme files (ls *.omp.*) before running the export","Run the command from src/ as documented (`--themes ../themes`)","Add a CI check that the themes directory is non-empty"],"tags":["cli","filesystem","themes","empty-input"],"backgroundTag":"no-files-found","analyzedSha":"0976794618c5ed95de0985dded50de1b4dc914cb","analyzedAt":"2026-08-31T23:41:19.708Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}