Skip to content

Commit

Permalink
Remove ora. (#113)
Browse files Browse the repository at this point in the history
It never worked for this project.
  • Loading branch information
XhmikosR committed Jan 5, 2021
1 parent 408b5bc commit 09d8d4f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 114 deletions.
16 changes: 4 additions & 12 deletions cli.js
Expand Up @@ -5,7 +5,6 @@
const path = require('path');
const commander = require('commander');
const chalk = require('chalk');
const ora = require('ora');
const { version } = require('./package.json');
const fusv = require('.');

Expand All @@ -17,40 +16,33 @@ commander

function main(args) {
const ignore = commander.ignore ? commander.ignore.split(',') : [];
const spinner = ora('');

console.log('Looking for unused variables');
spinner.start();

let unusedList = [];

args.forEach(arg => {
const dir = path.resolve(arg);

spinner.info(`Finding unused variables in "${chalk.cyan.bold(dir)}"...`);
spinner.start();
console.log(`Finding unused variables in "${chalk.cyan.bold(dir)}"...`);

// eslint-disable-next-line unicorn/no-array-callback-reference
const unusedVars = fusv.find(dir, { ignore });

spinner.info(`${chalk.cyan.bold(unusedVars.total)} total variables.`);
spinner.start();
console.log(`${chalk.cyan.bold(unusedVars.total)} total variables.`);

unusedVars.unused.forEach(unusedVar => {
spinner.fail(`Variable ${chalk.bold(unusedVar)} is not being used!`);
console.log(`Variable ${chalk.bold(unusedVar)} is not being used!`);
});

unusedList = unusedList.concat(unusedVars.unused);
spinner.start();
});

if (unusedList.length === 0) {
spinner.succeed('No unused variables found!');
spinner.stop();
console.log('No unused variables found!');
process.exit(0);
}

spinner.stop();
process.exit(1);
}

Expand Down
119 changes: 18 additions & 101 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Expand Up @@ -32,7 +32,6 @@
"commander": "^5.1.0",
"escape-string-regexp": "^4.0.0",
"glob": "^7.1.6",
"ora": "^5.2.0",
"postcss": "^8.2.2",
"postcss-scss": "^3.0.4"
},
Expand Down

0 comments on commit 09d8d4f

Please sign in to comment.