import path from 'path';

const yargs = require('yargs/yargs');
const { hideBin } = require('yargs/helpers');
const args = yargs(hideBin(process.argv)).argv;

export default () => {
  const codemodName = args.codemod;
  const codemodPath = path.resolve(
    __dirname,
    `../../codemods/${codemodName}/index.js`
  );

  const codemod = require(codemodPath);

  codemod.transform();
};
