fix: skip config loading for audit path mode

When `skillshare audit <path>` targets an existing file or directory,
config is not needed. Previously config.Load() ran unconditionally,
causing "config not found" errors in CI environments without a
skillshare config. Now path mode bypasses config loading entirely.
This commit is contained in:
Willie
2026-02-13 14:21:37 +08:00
parent 30fb64ddea
commit af8eae9005
+9 -1
View File
@@ -95,7 +95,15 @@ func cmdAudit(args []string) error {
cfgPath string
)
if mode == modeProject {
// Path mode: target is an existing file/directory — no config needed.
if opts.Target != "" && pathExists(opts.Target) {
if mode == modeProject {
projectRoot = cwd
cfgPath = config.ProjectConfigPath(cwd)
} else {
cfgPath = config.ConfigPath()
}
} else if mode == modeProject {
rt, err := loadProjectRuntime(cwd)
if err != nil {
return err