Update checked-in dependencies
This commit is contained in:
parent
4fad06f438
commit
40a500c743
4168 changed files with 298222 additions and 374905 deletions
20
node_modules/ava/lib/cli.js
generated
vendored
20
node_modules/ava/lib/cli.js
generated
vendored
|
|
@ -5,7 +5,6 @@ import process from 'node:process';
|
|||
|
||||
import arrify from 'arrify';
|
||||
import ciParallelVars from 'ci-parallel-vars';
|
||||
import {deleteAsync} from 'del';
|
||||
import figures from 'figures';
|
||||
import yargs from 'yargs';
|
||||
import {hideBin} from 'yargs/helpers'; // eslint-disable-line n/file-extension-in-import
|
||||
|
|
@ -140,6 +139,7 @@ export default async function loadCli() { // eslint-disable-line complexity
|
|||
|
||||
let resetCache = false;
|
||||
const {argv} = yargs(hideBin(process.argv))
|
||||
.scriptName('ava')
|
||||
.version(pkg.version)
|
||||
.parserConfiguration({
|
||||
'boolean-negation': true,
|
||||
|
|
@ -260,11 +260,23 @@ export default async function loadCli() { // eslint-disable-line complexity
|
|||
const {nonSemVerExperiments: experiments, projectDir} = conf;
|
||||
if (resetCache) {
|
||||
const cacheDir = path.join(projectDir, 'node_modules', '.cache', 'ava');
|
||||
|
||||
try {
|
||||
const deletedFilePaths = await deleteAsync('*', {cwd: cacheDir});
|
||||
let entries;
|
||||
try {
|
||||
entries = fs.readdirSync(cacheDir);
|
||||
} catch (error) {
|
||||
if (error.code === 'ENOENT') {
|
||||
entries = [];
|
||||
} else {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
if (deletedFilePaths.length === 0) {
|
||||
for (const entry of entries) {
|
||||
fs.rmSync(path.join(cacheDir, entry), {recursive: true, force: true});
|
||||
}
|
||||
|
||||
if (entries.length === 0) {
|
||||
console.log(`\n${chalk.green(figures.tick)} No cache files to remove`);
|
||||
} else {
|
||||
console.log(`\n${chalk.green(figures.tick)} Removed AVA cache files in ${cacheDir}`);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue