Skip to content

Commit 61dd290

Browse files
committed
refactored
1 parent 5068994 commit 61dd290

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/node_task_runner.cc

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -207,13 +207,9 @@ void ProcessRunner::OnExit(int64_t exit_status, int term_signal) {
207207
void ProcessRunner::Run() {
208208
// keeps the string alive until destructor
209209
if (!node::per_process::cli_options->run_in_directory.empty()) {
210-
if (std::filesystem::is_directory(
211-
node::per_process::cli_options->run_in_directory)) {
212-
cwd = node::per_process::cli_options->run_in_directory;
213-
} else {
214-
fprintf(stderr,
215-
"Error: %s is not a directory\n",
216-
node::per_process::cli_options->run_in_directory.c_str());
210+
cwd = node::per_process::cli_options->run_in_directory;
211+
if (!std::filesystem::is_directory(cwd)) {
212+
fprintf(stderr, "Error: %s is not a directory\n", cwd.c_str());
217213
init_result->exit_code_ = ExitCode::kGenericUserError;
218214
return;
219215
}

0 commit comments

Comments
 (0)