protected initialize()

in app/lib/arguments.ts [57:95]


	protected initialize(): Promise<void> {
		let initPromise = Promise.resolve<void>(null);
		if (this.assignedValue === undefined && (this.hasDefaultValue || this.givenValue === undefined)) {
			initPromise = getOptionsCache().then(cache => {
				let cacheKey =
					path.resolve().replace("/.[]/g", "-") +
					"." +
					common.EXEC_PATH.slice(0, common.EXEC_PATH.length - 1).join("/");
				let cachedValue = _.get<any, string>(cache, cacheKey + "." + this.name);
				let cachedValueStringArray: string[];
				if (typeof cachedValue === "string") {
					cachedValueStringArray = [cachedValue];
				} else if (_.isArray(cachedValue)) {
					cachedValueStringArray = cachedValue;
				}
				if (cachedValue !== undefined) {
					return this.getValue(cachedValueStringArray).then(result => {
						this.initializeAssignedValue(result);
					});
				} else if (this.givenValue !== null && this.givenValue !== undefined) {
					return this.getValue(this.givenValue).then(result => {
						this.initializeAssignedValue(result);
					});
				} else if (this.givenValue === null) {
					this.initializeAssignedValue(null);
				}
			});
		} else if (this.assignedValue === undefined) {
			if (this.givenValue === null) {
				this.initializeAssignedValue(null);
			} else if (this.givenValue !== undefined) {
				initPromise = this.getValue(this.givenValue).then(result => {
					this.initializeAssignedValue(result);
				});
			}
		}
		this.initializePromise = initPromise;
		return initPromise;
	}