Skip to content

Commit 8fee9f0

Browse files
Update src/node_task_runner.cc
Co-authored-by: Yagiz Nizipli <[email protected]>
1 parent df5f32e commit 8fee9f0

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/node_task_runner.cc

+5-6
Original file line numberDiff line numberDiff line change
@@ -206,12 +206,11 @@ void ProcessRunner::OnExit(int64_t exit_status, int term_signal) {
206206

207207
void ProcessRunner::Run() {
208208
// keeps the string alive until destructor
209-
std::string working_dir;
210-
if (!node::per_process::cli_options->run_in.empty())
211-
working_dir = node::per_process::cli_options->run_in;
212-
else
213-
working_dir = package_json_path_.parent_path().string();
214-
cwd = working_dir;
209+
if (!node::per_process::cli_options->run_in.empty()) {
210+
cwd = node::per_process::cli_options->run_in;
211+
} else {
212+
cwd = package_json_path_.parent_path().string();
213+
}
215214
options_.cwd = cwd.c_str();
216215
if (int r = uv_spawn(loop_, &process_, &options_)) {
217216
fprintf(stderr, "Error: %s\n", uv_strerror(r));

0 commit comments

Comments
 (0)