Skip to content

Commit

Permalink
Shell: Resolve aliases in builtin_time
Browse files Browse the repository at this point in the history
  • Loading branch information
alimpfard authored and awesomekling committed Jul 13, 2020
1 parent b0ce8d7 commit 7170df7
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions Shell/Builtin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -698,14 +698,17 @@ int Shell::builtin_time(int argc, const char** argv)
for (auto& arg : args)
command.argv.append(arg);

auto commands = expand_aliases({ move(command) });

Core::ElapsedTimer timer;
int exit_code = 1;
timer.start();
auto job = run_command(command);
if (!job)
return 1;
block_on_job(job);
for (auto& job : run_commands(commands)) {
block_on_job(job);
exit_code = job->exit_code();
}
fprintf(stderr, "Time: %d ms\n", timer.elapsed());
return job->exit_code();
return exit_code;
}

int Shell::builtin_umask(int argc, const char** argv)
Expand Down

0 comments on commit 7170df7

Please sign in to comment.