Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions web_generator/bin/gen_interop_bindings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,11 @@ $_usage''');
final inputFile = argResult.rest.first;
final outputFile = argResult['output'] as String? ??
p.join(p.current, inputFile.replaceAll('.d.ts', '.dart'));
final configFile =
argResult['config'] as String? ?? p.join(p.current, 'webgen.yaml');
final defaultWebGenConfigPath = p.join(p.current, 'webgen.yaml');
final configFile = argResult['config'] as String? ??
(File(defaultWebGenConfigPath).existsSync()
? defaultWebGenConfigPath
: null);
final relativeOutputPath =
p.relative(outputFile, from: bindingsGeneratorPath);
// Run app with `node`.
Expand All @@ -73,7 +76,7 @@ $_usage''');
'--declaration',
'--input=${p.relative(inputFile, from: bindingsGeneratorPath)}',
'--output=$relativeOutputPath',
'--config=$configFile'
if (configFile case final config?) '--config=$config'
],
workingDirectory: bindingsGeneratorPath,
);
Expand All @@ -100,5 +103,5 @@ final _parser = ArgParser()
..addOption('config',
hide: true,
abbr: 'c',
help: 'The configuration file to use for this tool (NOTE: Unimplemented)')
..addFlag('help', negatable: false);
help:
'The configuration file to use for this tool (NOTE: Unimplemented)');