generated from onedr0p/cluster-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.js
More file actions
31 lines (27 loc) · 920 Bytes
/
config.js
File metadata and controls
31 lines (27 loc) · 920 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// config.js
const fs = require('fs')
const JSON5 = require('json5')
const read5 = (p) => JSON5.parse(fs.readFileSync(p, 'utf8'))
const merge = (a, b) => {
if (Array.isArray(a) && Array.isArray(b)) return [...a, ...b]
if (a && typeof a === 'object' && b && typeof b === 'object') {
const out = { ...a }
for (const k of Object.keys(b)) out[k] = k in out ? merge(out[k], b[k]) : b[k]
return out
}
return b ?? a
}
// Base (drop the local> lines here)
const base = read5('.renovaterc.json5')
// Merge in your local preset fragments
const parts = [
'.renovate/autoMerge.json5',
'.renovate/customDomain.local.json5',
'.renovate/customManagers.json5',
'.renovate/grafanaDashboards.json5',
'.renovate/groups.json5',
'.renovate/labels.json5',
'.renovate/semanticCommits.json5',
'.renovate/talosFactory.json5'
].map(read5)
module.exports = parts.reduce((acc, cur) => merge(acc, cur), base)