the default configuration is first instantiated with base values
// default configurations, these values are set as ./local/manim.cfg.json
// note only values that are pre-set here are loaded
export var DEFAULT_CONFIG: ManimConfig & FallbackConfig = {
media_dir: "",
video_dir: "",
images_dir: "",
quality: "",
image_name: "",
frame_rate: "",
quality_map: {}
};
the updateFallbackManimCfg is run on extension load time
export function updateFallbackManimCfg(
updated: {
if (saveUpdated) {
fs.writeFile(PATHS.cfgMap!.fsPath, JSON.stringify(DEFAULT_CONFIG), () => {});
}
}
Issues:
1. It isn't obvious how the default configuration is loaded at a glance
2. Values loaded from the `manim.cfg.json` file is dependent on the base values set in the initial instantiation
To load the default configuration at the moment:
export function updateFallbackManimCfg( updated: {
}, saveUpdated: boolean = true ) { Object.keys(DEFAULT_CONFIG).forEach((ky) => { if (updated[ky]) { DEFAULT_CONFIG[ky as keyof ManimConfig] = updated[ky]; } });
if (saveUpdated) { fs.writeFile(PATHS.cfgMap!.fsPath, JSON.stringify(DEFAULT_CONFIG), () => {}); } }