From c76f89188ab5a0cca9756ba22daa806684405959 Mon Sep 17 00:00:00 2001 From: Joey Perrott Date: Thu, 26 Aug 2021 11:58:49 -0700 Subject: [PATCH] feat(ng-dev): allow for setting the cached configuration object imperatively (#180) PR Close #180 --- ng-dev/utils/config.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ng-dev/utils/config.ts b/ng-dev/utils/config.ts index d81db0dbc..c98fca748 100644 --- a/ng-dev/utils/config.ts +++ b/ng-dev/utils/config.ts @@ -48,6 +48,14 @@ const USER_CONFIG_FILE_PATH = '.ng-dev.user'; /** The local user configuration for ng-dev. */ let userConfig: {[key: string]: any} | null = null; +/** + * Set the cached configuration object to be loaded later. Only to be used on CI situations in + * which loading from the `.ng-dev/` directory is not possible. + */ +export function setConfig(config: {}) { + cachedConfig = config; +} + /** * Get the configuration from the file system, returning the already loaded * copy if it is defined.