Skip to content

Commit bc1fdbc

Browse files
committed
1 parent 7a34492 commit bc1fdbc

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

utils/bump/resources.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@
99
(async () => {
1010

1111
// Parse ARGS
12-
const args = process.argv.slice(2),
13-
cacheMode = args.some(arg => arg.startsWith('--cache')),
14-
devMode = args.some(arg => arg.startsWith('--dev'))
12+
const args = process.argv.slice(2)
13+
const config = {
14+
cacheMode: args.some(arg => arg.startsWith('--cache')),
15+
devMode: args.some(arg => arg.startsWith('--dev'))
16+
}
1517

1618
// Import LIBS
1719
const fs = require('fs'), // to read/write files
@@ -24,7 +26,7 @@
2426

2527
// Import BUMP UTILS
2628
let bump
27-
if (devMode) // bypass cache for latest bump-utils.mjs
29+
if (config.devMode) // bypass cache for latest bump-utils.mjs
2830
bump = await import('./bump-utils.mjs')
2931
else { // import sparsely updated remote bump-utils.min.mjs
3032
fs.mkdirSync(path.dirname(cachePaths.bumpUtils), { recursive: true })
@@ -42,9 +44,9 @@
4244
}
4345

4446
// Collect userscripts
45-
bump.log.working(`\n${ cacheMode ? 'Collecting' : 'Searching for' } userscripts...\n`)
47+
bump.log.working(`\n${ config.cacheMode ? 'Collecting' : 'Searching for' } userscripts...\n`)
4648
let userJSfiles = []
47-
if (cacheMode) {
49+
if (config.cacheMode) {
4850
try { // create missing cache file
4951
fs.mkdirSync(path.dirname(cachePaths.userJSpaths), { recursive: true })
5052
const fd = fs.openSync(cachePaths.userJSpaths,

0 commit comments

Comments
 (0)