I'm type-o positive. I often botch CLI commands in predictable ways, and then have to robotically fix the command.
Why can't I remember that it's --amend
, not --ammend
(two 'm's, really, what is my brain even doing there?)
Enter fixt
- a rule-based tool that'll grab the previous command, fix it, and then re-run it.
npm run dev:install
or yarn dev:install
- Type a command wrong
- Run the
fixt
command - Voila your mistake is fixed and re-run
Add additional rules/files to rules/*.js
like so:
module.exports = [
{
// Detect if the mistake occurred
test: /my mistake/,
apply: (command) => {
// Fix and return the corrected command string
return command.replace(/my mistake/gi, "all better");
},
},
];