Skip to content

Commit

Permalink
(minor) Execute chown first and remove useless log
Browse files Browse the repository at this point in the history
  • Loading branch information
axel-op committed Mar 6, 2024
1 parent d9b1353 commit 56afb7e
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions app/bin/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,27 +36,17 @@ dynamic main(List<String> args) async {
}

try {
// 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 ['config', '--no-analytics']),
);

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

// 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 ['config', '--no-analytics']),
);
if (chownProcessResult.exitCode > 0) {
logger.warning(
"Couldn't change ownership of $canonicalPathToRepoRoot: ${jsonEncode({
"stdout": chownProcessResult.stdout,
"stderr": chownProcessResult.stderr,
})}");
}

await analysis.start();

Expand Down

0 comments on commit 56afb7e

Please sign in to comment.