Skip to content

Commit

Permalink
allow "attach" and "down" subcommands to work, show it in ponysay exa…
Browse files Browse the repository at this point in the history
…mple
  • Loading branch information
VanCoding committed Oct 14, 2024
1 parent 29301ae commit 1c6fa84
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion example/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,12 @@
};
};

# nix run .#ponysay up to start the process
# nix run .#ponysay to start the process
# nun run .#ponysay attach to show the output
# nix run .#ponysay down to stop the process
packages.ponysay = (import inputs.process-compose-flake.lib { inherit pkgs; }).makeProcessCompose {
modules = [{
cli.up.detached = true;
settings = {
processes = {
ponysay.command = ''
Expand Down
4 changes: 2 additions & 2 deletions nix/process-compose/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ in
${preHook}
run-process-compose () {
set -x; process-compose ${cliOutputs.global} --config ${configFile} "$@"; set +x
set -x; process-compose ${cliOutputs.global} "$@"; set +x
}
# Run `up` command, with arguments; unless the user wants to pass their own subcommand.
if [ "$#" -eq 0 ]; then
run-process-compose up ${cliOutputs.up}
run-process-compose up --config ${configFile} ${cliOutputs.up}
else
run-process-compose "$@"
fi
Expand Down

0 comments on commit 1c6fa84

Please sign in to comment.