How to use the @stryker-mutator/util.fsAsPromised.existsSync function in @stryker-mutator/util

To help you get started, we’ve selected a few @stryker-mutator/util 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 stryker-mutator / stryker / packages / stryker / src / initializer / StrykerConfigWriter.ts View on Github external
public guardForExistingConfig() {
    if (fsAsPromised.existsSync(STRYKER_CONFIG_FILE)) {
      const msg =
        'Stryker config file "stryker.conf.js" already exists in the current directory. Please remove it and try again.';
      this.log.error(msg);
      throw new Error(msg);
    }
  }
github stryker-mutator / stryker / packages / core / src / initializer / GitignoreWriter.ts View on Github external
public async addStrykerTempFolder() {
    if (fsAsPromised.existsSync(GITIGNORE_FILE)) {
      const strykerTempFolderSpecification = `${os.EOL}# stryker temp files${os.EOL}*.stryker-tmp${os.EOL}`;
      await fsAsPromised.appendFile(GITIGNORE_FILE, strykerTempFolderSpecification);
      this.out('Note: Your .gitignore file has been updated to include recommended git ignore patterns for Stryker');
    } else {
      this.out('No .gitignore file could be found. Please add the following to your .gitignore file: *.stryker-tmp');
    }
  }
}
github stryker-mutator / stryker / packages / core / src / initializer / StrykerConfigWriter.ts View on Github external
public guardForExistingConfig() {
    if (fsAsPromised.existsSync(STRYKER_CONFIG_FILE)) {
      const msg = 'Stryker config file "stryker.conf.js" already exists in the current directory. Please remove it and try again.';
      this.log.error(msg);
      throw new Error(msg);
    }
  }