Module: lib-tde.function.application_runner
This module helps with running applications as defined in autostart.
Running software that guaranteed running only once can be troublesome. For example you have written a shell script that launches a webserver. We would only want to start the webserver once.
-- this will run the script lib-tde.function.application_runner.run_once(os.getenv("HOME") .. "/launch-webserver.sh") -- returns true -- this won't run the script lib-tde.function.application_runner.run_once(os.getenv("HOME") .. "/launch-webserver.sh") -- returns false
Info:
- Copyright: 2020 Tom Meyers
- Author: Tom Meyers
Static module functions
lib-tde.function.application_runner.run_once (cmd) -> bool | run a shell command asynchronously and run it only the first time |
Static module functions
- lib-tde.function.application_runner.run_once (cmd) -> bool
-
run a shell command asynchronously and run it only the first time
Parameters:
- cmd string The shell command to run
Returns:
-
bool
Returns true if the command ran
Usage:
-- This will return true lib-tde.function.application_runner.run_once("echo 'hello'")