How to use the @salesforce/core.ConfigFile.create function in @salesforce/core

To help you get started, we’ve selected a few @salesforce/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github eltoroit / ETCopyData / src / @ELTOROIT / Settings.ts View on Github external
private openConfigFile(configfolder: string): Promise> {
		this.configfolder = configfolder;
		if (!this.configfolder) {
			this.configfolder = ".";
		}
		return ConfigFile.create({
			filename: "ETCopyData.json",
			isGlobal: false,
			isState: false,
			rootFolder: this.configfolder,
		});
	}
github forcedotcom / salesforcedx-vscode / packages / salesforcedx-vscode-core / src / commands / forceAuthDevHub.ts View on Github external
public async setGlobalDefaultDevHub(newUsername: string): Promise {
    const homeDirectory = homedir();

    const globalConfig = await ConfigFile.create({
      isGlobal: true,
      rootFolder: homeDirectory,
      filename: SFDX_CONFIG_FILE
    });

    globalConfig.set(DEFAULT_DEV_HUB_USERNAME_KEY, newUsername);
    await globalConfig.write();
  }
}
github forcedotcom / salesforcedx-vscode / packages / salesforcedx-vscode-core / src / util / configUtil.ts View on Github external
public static async getConfigValue(
    key: string,
    source?: ConfigSource.Global | ConfigSource.Local
  ): Promise {
    if (isUndefined(source) || source === ConfigSource.Local) {
      try {
        const rootPath = getRootWorkspacePath();
        const myLocalConfig = await ConfigFile.create({
          isGlobal: false,
          rootFolder: path.join(rootPath, '.sfdx'),
          filename: 'sfdx-config.json'
        });
        const localValue = myLocalConfig.get(key);
        if (!isNullOrUndefined(localValue)) {
          return localValue;
        }
      } catch (err) {
        telemetryService.sendException('get_config_value_local', err.message);
        return undefined;
      }
    }
    if (isUndefined(source) || source === ConfigSource.Global) {
      try {
        const aggregator = await ConfigAggregator.create();