Skip to content

New feat req for echoing shell commands #103

@ikappaki

Description

@ikappaki

Hi,

it is considered a useful aid in shell scripting to echo the commands being executed.

This is a request to include such an :echo true option in shell or/and process (defaults to false).

e.g.

(babashka.process/shell {:echo true} "ls" "-al")
;; => /usr/bin/ls -al
...

This should work well with the babashka.process/*defaults* for echoing all commands in a block, e.g.

(binding [p/*defaults* (assoc p/*defaults* :echo true)]
  (p/shell "ls" "-al"))

would it be also possible to expose babashka.tasks/*defaults* in babashka please, it seems to be missing (babashka.process/*defaults* though is working fine).

Another idea discussed in slack is whether it will also be a good idea to include convenience fn such as

(babashka.process/set-default :echo true)

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions