Skip to content

Commit 74f83f4

Browse files
authored
Merge pull request #966 from rubensworks/fix/migrate-config-templates
Make migration tool also scan through config/templates
2 parents 1aa9860 + 886cc1d commit 74f83f4

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

bin/lib/migrateLegacyResources.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,15 @@ module.exports = function (program) {
2020
.action(async (opts) => {
2121
const verbose = opts.verbose
2222
const suffix = opts.suffix || '$.ttl'
23-
let path = opts.path || 'data'
24-
path = path.startsWith(Path.sep) ? path : Path.join(process.cwd(), path)
25-
if (verbose) {
26-
console.log(`Migrating files in ${path}`)
27-
}
23+
let paths = opts.path ? [ opts.path ] : [ 'data', 'config/templates' ]
24+
paths = paths.map(path => path.startsWith(Path.sep) ? path : Path.join(process.cwd(), path))
2825
try {
29-
await migrate(path, suffix, verbose)
26+
for (const path of paths) {
27+
if (verbose) {
28+
console.log(`Migrating files in ${path}`)
29+
}
30+
await migrate(path, suffix, verbose)
31+
}
3032
} catch (err) {
3133
console.error(err)
3234
}

0 commit comments

Comments
 (0)