Eslint fix

This commit is contained in:
Izuco 2022-01-15 16:34:04 +01:00
parent a3a50e97c1
commit 9513cead33
No known key found for this signature in database
GPG key ID: E9CBE9E4EF3A1BFA
2 changed files with 23 additions and 23 deletions

View file

@ -1,18 +1,18 @@
import packageJSON from '../package.json';
import fs from "fs";
import path from "path";
import { availableFilenameVars, args, groups } from './module.args';
import fs from 'fs';
import path from 'path';
import { args, groups } from './module.args';
const transformService = (str: 'funi'|'crunchy'|'both') => {
switch (str) {
case 'both':
return 'Both';
case 'crunchy':
return 'Crunchyroll';
case 'funi':
return 'Funimation';
case 'both':
return 'Both';
case 'crunchy':
return 'Crunchyroll';
case 'funi':
return 'Funimation';
}
}
};
let docs = `# ${packageJSON.name} (${packageJSON.version}v)
@ -36,24 +36,24 @@ Object.entries(groups).forEach(([key, value]) => {
docs += args.filter(a => a.group === key).map(argument => {
return [`#### \`${argument.name.length > 1 ? '--' : '-'}${argument.name}\``,
`| **Service** | **Usage** | **Type** | **Required** | **Alias** | ${argument.choices ? `**Choices** |` : ''} ${argument.default ? `**Default** |` : ''}**cli-default Entry**`,
`| --- | --- | --- | --- | --- | ${argument.choices ? '--- | ' : ''}${argument.default ? '--- | ' : ''}---| `,
`| ${transformService(argument.service)} | \`${argument.name.length > 1 ? '--' : '-'}${argument.name} ${argument.usage}\` | \`${argument.type}\` | \`${argument.demandOption ? 'Yes' : 'No'}\`|`
`| **Service** | **Usage** | **Type** | **Required** | **Alias** | ${argument.choices ? '**Choices** |' : ''} ${argument.default ? '**Default** |' : ''}**cli-default Entry**`,
`| --- | --- | --- | --- | --- | ${argument.choices ? '--- | ' : ''}${argument.default ? '--- | ' : ''}---| `,
`| ${transformService(argument.service)} | \`${argument.name.length > 1 ? '--' : '-'}${argument.name} ${argument.usage}\` | \`${argument.type}\` | \`${argument.demandOption ? 'Yes' : 'No'}\`|`
+ ` \`${(argument.alias ? `${argument.alias.length > 1 ? '--' : '-'}${argument.alias}` : undefined) ?? 'NaN'}\` |`
+ `${argument.choices ? ` [${argument.choices.map(a => `\`${a || `''`}\``).join(', ')}] |` : ''}`
+ `${argument.choices ? ` [${argument.choices.map(a => `\`${a || '\'\''}\``).join(', ')}] |` : ''}`
+ `${argument.default ? ` \`${
typeof argument.default === 'object'
? Array.isArray(argument.default)
? JSON.stringify(argument.default)
: argument.default.default
: argument.default
? Array.isArray(argument.default)
? JSON.stringify(argument.default)
: argument.default.default
: argument.default
}\`|` : ''}`
+ ` ${typeof argument.default === 'object' && !Array.isArray(argument.default)
? `\`${argument.default.name || argument.name}: \``
: '`NaN`'
} |`,
'',
argument.docDescribe === true ? argument.describe : argument.docDescribe
'',
argument.docDescribe === true ? argument.describe : argument.docDescribe
].join('\n');
}).join('\n');
});

View file

@ -89,15 +89,15 @@ export default (async (force = false) => {
a.status === 'modified' ? '*' : a.status === 'added' ? '+' : '-'
}] ${a.filename}`).join('\n')}`);
let remove: string[] = [];
const remove: string[] = [];
changedFiles.filter(a => a.status !== 'added').forEach(async a => {
if (!askBeforeUpdate.some(pattern => matchString(pattern, a.filename)))
return;
let answer = await seiHelper.question(`The developer decided that the file '${a.filename}' may contain information you changed yourself. Should they be overriden to be updated? [y/N]`);
const answer = await seiHelper.question(`The developer decided that the file '${a.filename}' may contain information you changed yourself. Should they be overriden to be updated? [y/N]`);
if (answer.toLowerCase() === 'y')
remove.push(a.sha);
})
});
const changesToApply = await Promise.all(changedFiles.filter(a => !remove.includes(a.sha)).map(async (a): Promise<ApplyItem> => {
if (a.filename.endsWith('.ts')) {