How to use the @stryker-mutator/util.fsAsPromised.appendFile 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 / 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');
    }
  }
}