How to use the @expo/config.setCustomConfigPath function in @expo/config

To help you get started, we’ve selected a few @expo/config 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 expo / expo-cli / packages / expo-cli / src / exp.ts View on Github external
return this.asyncAction(async (projectDir: string, ...args: any[]) => {
    const opts = args[0];

    if (!projectDir) {
      projectDir = process.cwd();
    } else {
      projectDir = path.resolve(process.cwd(), projectDir);
    }

    if (opts.config) {
      const pathToConfig = path.resolve(process.cwd(), opts.config);
      if (!fs.existsSync(pathToConfig)) {
        throw new Error(`File at provide config path does not exist: ${pathToConfig}`);
      }
      ConfigUtils.setCustomConfigPath(projectDir, pathToConfig);
    }

    const logLines = (msg: any, logFn: (...args: any[]) => void) => {
      if (typeof msg === 'string') {
        for (let line of msg.split('\n')) {
          logFn(line);
        }
      } else {
        logFn(msg);
      }
    };

    const logStackTrace = (
      chunk: LogRecord,
      logFn: (...args: any[]) => void,
      nestedLogFn: (...args: any[]) => void