Skip to content

Commit

Permalink
Default studies_dir parameter to 'studies' and seed path to seed.bin.
Browse files Browse the repository at this point in the history
  • Loading branch information
goodov committed Oct 23, 2024
1 parent f714541 commit ad50f01
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/scripts/lint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function getLintAllCommands(options: Options): string[] {
return [
'prettier . --ignore-unknown' + (options.fix ? ' --write' : ' --check'),
'eslint . --config src/.eslintrc.js' + (options.fix ? ' --fix' : ''),
'npm run seed_tools -- lint studies' + (options.fix ? ' --fix' : ''),
'npm run -- seed_tools lint' + (options.fix ? ' --fix' : ''),
];
}

Expand All @@ -52,7 +52,7 @@ function getLintDiffCommands(options: Options): Record<string, any> {
'*.{ts,js,tsx,jsx}':
'eslint --config src/.eslintrc.js' + (options.fix ? ' --fix' : ''),
'studies/*': () =>
'npm run seed_tools -- lint studies' + (options.fix ? ' --fix' : ''),
'npm run -- seed_tools lint' + (options.fix ? ' --fix' : ''),
};
}

Expand Down
8 changes: 6 additions & 2 deletions src/seed_tools/commands/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,12 @@ import { readStudiesToSeed } from '../utils/studies_to_seed';
export default function createCommand() {
return new Command('create')
.description('Create seed.bin from study files')
.argument('<studies_dir>', 'path to the directory containing study files')
.argument('<output_seed_file>', 'output seed file')
.argument(
'[studies_dir]',
'path to the directory containing study files',
'studies',
)
.argument('[output_seed_file]', 'output seed file', 'seed.bin')
.option('--mock_serial_number <value>', 'mock serial number')
.option(
'--output_serial_number_file <path>',
Expand Down
6 changes: 5 additions & 1 deletion src/seed_tools/commands/lint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ import { readStudiesToSeed } from '../utils/studies_to_seed';
export default function createCommand() {
return new Command('lint')
.description('Lint study files without creating seed.bin')
.argument('<studies_dir>', 'path to the directory containing study files')
.argument(
'[studies_dir]',
'path to the directory containing study files',
'studies',
)
.option('--fix', 'fix format errors in-place')
.action(lintStudies);
}
Expand Down

0 comments on commit ad50f01

Please sign in to comment.