Module dkb.exec

Module to easily invoke os commands.

Powered by hs.task, launches async tasks and can wait for them synchronously inside a coroutine through applicationYield function.

Functions

async (cmd, args[, completion]) Executes a cmd asyncrhonously
sync (cmd, args[, completion]) Executes a cmd syncrhonously


Functions

Methods
async (cmd, args[, completion])
Executes a cmd asyncrhonously

Parameters:

  • cmd string Command to execute (needs full path)
  • args string Arguments in a string separated by a space
  • completion func Executed after the task finishes (optional)

Returns:

    hs.task The task that was started with the provided cmd and args
sync (cmd, args[, completion])
Executes a cmd syncrhonously

Parameters:

  • cmd string Command to execute (needs full path)
  • args string Arguments in a string separated by a space
  • completion func Executed after the task finishes before returning (optional)

Returns:

    int, string or string Return code, stdout and stderr of the executed cmd
generated by LDoc 1.5.0 Last updated 2023-10-31 00:05:48