Skip to content

Commit

Permalink
chore(cli): defaults to javasript
Browse files Browse the repository at this point in the history
  • Loading branch information
marabesi committed Aug 3, 2024
1 parent f680192 commit 0f69d5e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion vscode/src/modules/cli/find-smells.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import fs, { readdir } from 'node:fs/promises';
import { SmellDetector } from '../smells-finder/smells-detector';
import { join } from 'node:path';
import { SupportedLanguages } from '../smells-finder/types';

const args = process.argv;
const fileName = args[2];
const language = args[3];
const language = args[3] || SupportedLanguages.javascript;

if (!fileName) {
console.error('[SMELLY] please provide a test file');
Expand All @@ -24,6 +25,7 @@ async function execute() {
if (isFile && isFile.isFile()) {
const fileContents = await fs.readFile(fileName, { encoding: 'utf8' });
const smellDetector = new SmellDetector(fileContents, language);
console.info(`Detecting for language ${language}`);
console.info(smellDetector.findAll());
return;
}
Expand Down

0 comments on commit 0f69d5e

Please sign in to comment.