Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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);
}
}
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');
}
}
}
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);
}
}