This repository has been archived by the owner on Jun 29, 2022. It is now read-only.
v1.6.0
Adds the option to the run_cmd
to use a string instead of only lists for the cmd
parameter.
It extends the library to use in INSTALL.sh
or UPDATE.sh
scripts.
def run_cmd(msg, cmd, ok_msg="", err_msg="", exit_msg="", exit_all=False, cwd=None):
"""Helper function to execute a command and use spinners.
Parameters
----------
msg : str
You should describe what the command is doing in simple words.
cmd : str, list
The command you want to execute. Each parameter can be added to the list.
ok_msg : str, optional
The text you want to display if the command is executed successfully.
err_msg : str, optional
The text you want to display if the command fails.
exit_msg : str, optional
The additional information you want to display if the whole script is stopped.
exit_all : bool, optional
Whether you want to exit the complete script if the command fails.
cwd : str, optional
The path to the working directory.
Returns
-------
True if the command was successful else it returns False.
"""