Allow to pass extra arguments to Ormolu

This commit is contained in:
Mark Karpov 2020-11-15 21:33:30 +01:00
parent 04134d97eb
commit 31843198af
No known key found for this signature in database
GPG Key ID: 8564658B2889FF7C
2 changed files with 22 additions and 2 deletions

12
dist/index.js vendored
View File

@ -67,12 +67,22 @@ async function run() {
);
const files = await globber.glob();
// Extra args
var extra_args = [];
if (input_extra_args) {
extra_args = input_extra_args.split(' ');
}
// Run ormolu
await exec.exec(ormolu_cached_path, ['--version']);
await exec.exec(
ormolu_cached_path,
['--color', 'always', '--check-idempotence', '--mode', 'check'].concat(files)
['--color', 'always', '--check-idempotence', '--mode', 'check']
.concat(extra_args)
.concat(files)
);
} catch (error) {

View File

@ -56,12 +56,22 @@ async function run() {
);
const files = await globber.glob();
// Extra args
var extra_args = [];
if (input_extra_args) {
extra_args = input_extra_args.split(' ');
}
// Run ormolu
await exec.exec(ormolu_cached_path, ['--version']);
await exec.exec(
ormolu_cached_path,
['--color', 'always', '--check-idempotence', '--mode', 'check'].concat(files)
['--color', 'always', '--check-idempotence', '--mode', 'check']
.concat(extra_args)
.concat(files)
);
} catch (error) {