|
36 | 36 |
|
37 | 37 | // Import BUMP UTILS |
38 | 38 | let bump |
39 | | - if (config.devMode) // bypass cache for latest bump-utils.mjs |
| 39 | + if (app.config.devMode) // bypass cache for latest bump-utils.mjs |
40 | 40 | bump = await import('./bump-utils.mjs') |
41 | 41 | else { // import remote bump-utils.min.mjs updated every ~12h |
42 | 42 | fs.mkdirSync(path.dirname(cachePaths.bumpUtils), { recursive: true }) |
|
46 | 46 | } |
47 | 47 |
|
48 | 48 | // COLLECT chatbot userscripts |
49 | | - bump.log.working(`\n${ config.cacheMode ? 'Collecting' : 'Searching for' } chatbot userscripts...\n`) |
| 49 | + bump.log.working(`\n${ app.config.cacheMode ? 'Collecting' : 'Searching for' } chatbot userscripts...\n`) |
50 | 50 | let chatbotFiles = [] |
51 | | - if (config.cacheMode) |
| 51 | + if (app.config.cacheMode) |
52 | 52 | try { // create missing cache file |
53 | 53 | fs.mkdirSync(path.dirname(cachePaths.chatbotPaths), { recursive: true }) |
54 | 54 | const fd = fs.openSync(cachePaths.chatbotPaths, |
|
93 | 93 | } else bump.log.success(`${filesUpdatedCnt} chatbot${pluralSuffix} bumped!`) |
94 | 94 |
|
95 | 95 | // ADD/COMMIT/PUSH bump(s) |
96 | | - if (config.commitMsg) { |
| 96 | + if (app.config.commitMsg) { |
97 | 97 | bump.log.working(`\nCommitting bump${pluralSuffix} to Git...\n`) |
98 | 98 | try { |
99 | 99 | execSync('git add ./*.user.js') |
100 | | - spawnSync('git', ['commit', '-n', '-m', config.commitMsg], { stdio: 'inherit', encoding: 'utf-8' }) |
| 100 | + spawnSync('git', ['commit', '-n', '-m', app.config.commitMsg], { stdio: 'inherit', encoding: 'utf-8' }) |
101 | 101 | console.log('') // line break |
102 | | - if (!config.noPush) { |
| 102 | + if (!app.config.noPush) { |
103 | 103 | bump.log.working('\nPulling latest changes from remote to sync local repository...\n') |
104 | 104 | execSync('git pull') |
105 | 105 | bump.log.working(`\nPushing bump${pluralSuffix} to Git...\n`) |
106 | 106 | execSync('git push') |
107 | 107 | } |
108 | 108 | bump.log.success(`Success! ${filesUpdatedCnt} chatbot${pluralSuffix} updated/committed${ |
109 | | - !config.noPush ? '/pushed' : '' } to GitHub`) |
| 109 | + !app.config.noPush ? '/pushed' : '' } to GitHub`) |
110 | 110 | } catch (err) { bump.log.error('Git operation failed: ' + err.message) } |
111 | 111 | } else { |
112 | 112 | bump.log.working(`\nNo commit message provided. Skipping git operations.`) |
|
0 commit comments