forked from CIT/Vmeda.Online
		
	MOBILE-3320 DX: Fix config files naming
This commit is contained in:
		
							parent
							
								
									856ac1915b
								
							
						
					
					
						commit
						045d81f482
					
				
							
								
								
									
										4
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@ -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
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										2
									
								
								.vscode/settings.json
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.vscode/settings.json
									
									
									
									
										vendored
									
									
								
							@ -2,7 +2,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    "files.associations": {
 | 
					    "files.associations": {
 | 
				
			||||||
        "moodle.config.json": "jsonc",
 | 
					        "moodle.config.json": "jsonc",
 | 
				
			||||||
        "moodle.*.config.json": "jsonc",
 | 
					        "moodle.config.*.json": "jsonc",
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -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());
 | 
				
			||||||
 | 
				
			|||||||
@ -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'));
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user