Replies: 3 comments
-
Not sure if possible, but what if we use dax as the default interpreter for every cmd? I guess it's just a wrapper around Sorry I've been so busy lately, but still following the project 👍. |
Beta Was this translation helpful? Give feedback.
-
I can make a try using dax, the code to run processes is only about 20 sloc 😃 Lines 80 to 103 in 6dbac5e @dsherret I'm working on a poc dax runner. Checking out the documentation of dax, a couple of (hopefully) quick questions pops up that would be great if you could have a look at 🙏 : let child = $.raw`${commandString}`.stdout("piped").stderr("piped") <-
// Question 1. Is it possible to have a fully dynamic command string with
// arguments, like ["deno run -A","/path/with spaces and/stuff",
// "&& echo","Hello world!"]
if (this.processConfig.cwd) child = child.cwd(this.processConfig.cwd)
if (env) child = child.env(env)
this.process = child.spawn()
this.process = child.spawn()
runningCallback(/*pid*/0) // <- Question 2: How to get the pid of the process, is it possible
// today, is it even relevant when running processes using a shell?
// Optimally i would want the pid of the currently executing process if many are chained
this.writePidFile()
this.pipeToLogger("stdout", this.process.stdout())
this.pipeToLogger("stderr", this.process.stderr())
const result = await this.process
// this.process.ref() // <- Question 3: Is it possible to ref the child process to force it exit
// along with the parent using dax? And the last question, are there any obvious reasons why i get "Pipe error" every now and then? |
Beta Was this translation helpful? Give feedback.
-
Implemented in main and included in pup since Line 87 in 21fd1bd |
Beta Was this translation helpful? Give feedback.
-
Ability to chain processes using && and || just like https://github.com/denoland/deno_task_shell
Would allow for some cool solutions where only the last result of the chain affects restart strategies etc.
Example configuration where task 2 only runs if task1 fals
{
processes [
{
"id": "my-task-chain",
"cmd": ["deno","run","task1.ts","||","deno","run","task2.ts"],
"autostart": true
}
}
}
Thoughts?
Other uses for running all commands through a custom shell?
Beta Was this translation helpful? Give feedback.
All reactions