adhdproject / buildkit-ng

New version of the buildkit repository
7 stars 8 forks source link

Intelligent Error Handling #37

Open 0x6d6f7468 opened 4 years ago

0x6d6f7468 commented 4 years ago

Add intelligent error handling to scripts.

My current plan is to use the following function:

runcmd() {
        $1 2>/dev/null;
        s=$(($s+$?));
}

where $s is a local variable for status code (subject to change), and $1 is the command to be executed. This is a concise way to keep track of return codes, because most errors that can be encountered are not fatal to the script. This way, we can simply return $s from the end of both install and uninstall functions and the caller can handle the output.

0x6d6f7468 commented 4 years ago

Artillery script has been adapted to a new style. Need to decide if it's the best method.