const fs = require('fs');

const transform = (fileInfo, api, options) => {
  const filePath = fileInfo.path;
  const regex = /sentry\.\w+\.config\.(ts|js)$|sentry\.properties$/i;

  if (regex.test(filePath) && fs.existsSync(filePath)) {
    fs.unlinkSync(filePath);
  }

  return fileInfo.source;
};

module.exports = transform;
