Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

working_dir doesn't work #25

Open
MrFoxPro opened this issue Jun 25, 2023 · 1 comment
Open

working_dir doesn't work #25

MrFoxPro opened this issue Jun 25, 2023 · 1 comment

Comments

@MrFoxPro
Copy link

MrFoxPro commented Jun 25, 2023

process-compose.dev = {
  debug = true;
  tui = false;
  settings = {
    processes = {
      web = {
        command = "echo $PWD";
        working_dir = with {p = toString ./api;}; builtins.trace p p;
      };
    };
  };
};

output:

processes:
  web:
    command: echo $PWD
    working_dir: /nix/store/3cb5iy8l8hffi5cpmxx3dm2sx7gfk4a1-source/api
shell:
  shell_argument: -c
  shell_command: /nix/store/mh1c3p23xby3chc3q0c0g78fa1nn65yw-bash-5.2-p15/bin/bash
[web_1  ] /home/foxpro/craft/sferadel/next

It doesn't work even with under $HOME:

web = {
  command = "bash -c \"echo $PWD; (cd /home/foxpro/craft/sferadel/next/api; echo $PWD)\"";
  working_dir = "/home/foxpro/craft/sferadel/next/api";
};
processes:
  web:
    command: bash -c "echo $PWD; (cd /home/foxpro/craft/sferadel/next/api; echo $PWD)"
    working_dir: /home/foxpro/craft/sferadel/next/api
shell:
  shell_argument: -c
  shell_command: /nix/store/mh1c3p23xby3chc3q0c0g78fa1nn65yw-bash-5.2-p15/bin/bash
[web_1  ] /home/foxpro/craft/sferadel/next
[web_1  ] /home/foxpro/craft/sferadel/next
@MrFoxPro
Copy link
Author

Hm, it's working when running from package, but not from shell:

web = {
  command = pkgs.nuenv.mkSimpleScript "cmd.nu" "print 'HI'; print $env.PWD ";
  working_dir = "/home/foxpro/craft/sferadel/next/api";
};
processes:
  web:
    command: /nix/store/26y922y4rdvf8hhwarqi7n50izmndjbz-cmd.nu/bin/cmd.nu
    working_dir: /home/foxpro/craft/sferadel/next/api
shell:
  shell_argument: -c
  shell_command: /nix/store/mh1c3p23xby3chc3q0c0g78fa1nn65yw-bash-5.2-p15/bin/bash
[web_1  ] HI
[web_1  ] /home/foxpro/craft/sferadel/next/api

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant