feat(sync): update extras source path to extras/<name>/ with auto-migration

This commit is contained in:
Willie
2026-03-12 16:45:02 +08:00
parent 6ece5c3e44
commit 0fcf6d1ee3
+9 -2
View File
@@ -37,7 +37,14 @@ func cmdSyncExtras(args []string) error {
return nil
}
sourceRoot := filepath.Dir(cfg.Source) // ~/.config/skillshare/
configDir := filepath.Dir(cfg.Source)
// Auto-migrate legacy extras directories (flat → extras/<name>/)
if warnings := config.MigrateExtrasDir(configDir, cfg.Extras); len(warnings) > 0 {
for _, w := range warnings {
ui.Warning(w)
}
}
if dryRun {
ui.Warning("Dry run mode - no changes will be made")
@@ -46,7 +53,7 @@ func cmdSyncExtras(args []string) error {
var totalSynced, totalSkipped, totalPruned, totalErrors int
for _, extra := range cfg.Extras {
extraSource := filepath.Join(sourceRoot, extra.Name)
extraSource := config.ExtrasSourceDir(cfg.Source, extra.Name)
ui.Header(capitalize(extra.Name))