MOBILE-3320 DX: Fix config files naming

main
Noel De Martin 2021-05-05 17:37:38 +02:00
parent 856ac1915b
commit 045d81f482
5 changed files with 5 additions and 5 deletions

4
.gitignore vendored
View File

@ -30,8 +30,8 @@ npm-debug.log*
/www /www
/src/assets/lib /src/assets/lib
/moodle.*.config.json /moodle.config.*.json
!/moodle.example.config.json !/moodle.config.example.json
/src/assets/lang/* /src/assets/lang/*
/src/assets/env.json /src/assets/env.json

View File

@ -2,7 +2,7 @@
"files.associations": { "files.associations": {
"moodle.config.json": "jsonc", "moodle.config.json": "jsonc",
"moodle.*.config.json": "jsonc", "moodle.config.*.json": "jsonc",
}, },
} }

View File

@ -25,7 +25,7 @@ function getConfig(environment) {
}; };
const config = parseJsonc(readFileSync(resolve(__dirname, '../moodle.config.json')).toString()); const config = parseJsonc(readFileSync(resolve(__dirname, '../moodle.config.json')).toString());
const envSuffixes = (envSuffixesMap[environment] || []); const envSuffixes = (envSuffixesMap[environment] || []);
const envConfigPath = envSuffixes.map(suffix => resolve(__dirname, `../moodle.${suffix}.config.json`)).find(existsSync); const envConfigPath = envSuffixes.map(suffix => resolve(__dirname, `../moodle.config.${suffix}.json`)).find(existsSync);
if (envConfigPath) { if (envConfigPath) {
const envConfig = parseJsonc(readFileSync(envConfigPath).toString()); const envConfig = parseJsonc(readFileSync(envConfigPath).toString());

View File

@ -48,5 +48,5 @@ gulp.task('default', gulp.parallel(['lang', 'env']));
gulp.task('watch', () => { gulp.task('watch', () => {
gulp.watch(paths.lang, { interval: 500 }, gulp.parallel('lang')); gulp.watch(paths.lang, { interval: 500 }, gulp.parallel('lang'));
gulp.watch(['./moodle.config.json', './moodle.*.config.json'], { interval: 500 }, gulp.parallel('env')); gulp.watch(['./moodle.config.json', './moodle.config.*.json'], { interval: 500 }, gulp.parallel('env'));
}); });