Skip to content
This repository was archived by the owner on May 17, 2023. It is now read-only.
This repository was archived by the owner on May 17, 2023. It is now read-only.

Current working directory is incorrect if targetApp.cwd is not specified. #22

@Ishotihadus

Description

@Ishotihadus

I think the code is intended to use pm_cwd as a current working directory if targetApp.cwd is not specified.

targetApp.cwd = apps[0].pm_cwd ? apps[0].pm_cwd : apps[0].pm2_env.pm_cwd;

But execOptions is not updated in this process, so an unintended directory is used as a current working directory on preHook and postHook.

I think the easiness solution is adding execOptions.cwd = targetApp.cwd; after updating targetApp.cwd.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions