Using Commands from Pluto

Is it possible to use external operating system commands from Pluto to automate the fossil add harold/tiddlers/* step, so that only the final commit has to be done manually from the console?

Hi! Yes, you can run shell commands from within Julia and hence Pluto notebooks, e.g. you can run the “list directory” command ls on Unix-like systems by running a cell containing this code:

run(`ls`)

This creates a “command object” of type Cmd and then runs this command with the function run. You can check the documentation of run and Cmd for a lot more details on how to run this.

Beware that all cells will be run at every startup of a Pluto notebook and all cells that depend on changed cells will also be re-run upon changes. With external shell commands this may or may not be what you want, but there are also ways to avoid running the “command cell” every time you change some dependency of it.

PS: The run will return the result of the process, so it will usually print the output or show some error codes if the command failed.