Skip to content

Commit

Permalink
Get ownership of directory before analysing it (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
axel-op committed Mar 5, 2024
1 parent 1a22ef7 commit f6b7d4f
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions app/bin/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,22 @@ dynamic main(List<String> args) async {
// Command to disable analytics reporting, and also to prevent a warning from the next command due to Flutter welcome screen
await logger.group(
'Disabling Flutter analytics',
() => gaction.exec('flutter', const <String>['config', '--no-analytics']),
() => gaction.exec('flutter', const ['config', '--no-analytics']),
);

final canonicalPathToPackage = inputs.paths.canonicalPathToPackage;
final userProcessResult = await gaction.exec('whoami', [], silent: true);
final user = (userProcessResult.stdout as String).trim();
logger.debug('whoami returned: $user');
gaction.exec('chown', [user, '-R', canonicalPathToPackage]);

await analysis.start();

// Executing the analysis
logger.startGroup('Running pana');
final panaProcessResult = await gaction.exec(
'pana',
<String>[
'--json',
'--no-warning',
inputs.paths.canonicalPathToPackage,
],
['--json', '--no-warning', canonicalPathToPackage],
);
logger.endGroup();

Expand Down

0 comments on commit f6b7d4f

Please sign in to comment.