Closed nikolaigut closed 3 years ago
Hi, thanks for the contribution!
I think it is bad practice to suggest the presence of a well-known feature when it is, in fact, not that feature - in this case command chaining as implemented by *sh.
I think I would rather have multiple --build
arguments for multiple commands than add complexity in the form of string parsing (and escaping of special character sequences like &&
).
The invocation would look like this:
CompileDaemon --build "go mod vendor" --build "go build" .
This would also not add the ability to do something like --build "go mod vendor || (echo "no update" && go build)"
but on the other hand it does not suggest that it is capable of doing that. For more complex cases I would always recommend to use shell scripts and execute them instead anyway.
What do you think?
@githubnemo many thanks for your review and suggestions for improvement.
I've changed to code to allow using the --build
flag multiple times instead of using the shell separator &&
.
Also, I extracted the functionality to run a build command into a separate method.
@githubnemo I've added some more log events.
@githubnemo thanks for your change suggestions.
Great addition, thanks for your work! :)
Currently, it is not possible to run multiple commands with the flag
--build
.With this change, it is possible to run multiple commands defined in the
--build
flag.The commands must be separated by a double ampersand (
&&
).For example,
CompileDaemon --build="go mod vendor && go build"
.This change should fix #52 .