Add ? to kickstart.debugging
This commit is contained in:
		| @@ -7,7 +7,7 @@ | ||||
| * [kickstart.apt.ppa](kickstart/apt/ppa) | ||||
| * [kickstart.command_exists](kickstart/command_exists) | ||||
| * [kickstart.context](kickstart/context) | ||||
| * [kickstart.debugging](kickstart/debugging) | ||||
| * [kickstart.debugging?](kickstart/debugging?) | ||||
| * [kickstart.download.file](kickstart/download/file) | ||||
| * [kickstart.download.stream](kickstart/download/stream) | ||||
| * [kickstart.file.contains](kickstart/file/contains) | ||||
|   | ||||
| @@ -1,15 +1,15 @@ | ||||
| # kickstart.debugging | ||||
| # kickstart.debugging? | ||||
| 
 | ||||
| Returns 0 if you are debugging, and 1 if not | ||||
| 
 | ||||
| ### Example | ||||
| 
 | ||||
| ```bash | ||||
| $ kickstart.debugging || echo nope | ||||
| $ kickstart.debugging? || echo nope | ||||
| nope | ||||
| 
 | ||||
| $ set -x; kickstart.debugging && echo yup; set +x; | ||||
| + kickstart.debugging | ||||
| $ set -x; kickstart.debugging? && echo yup; set +x; | ||||
| + kickstart.debugging? | ||||
| + grep xtrace | ||||
| + kickstart.stream.contains on | ||||
| + grep -q on | ||||
| @@ -8,13 +8,13 @@ kickstart.context() { | ||||
|   kickstart_context="$@" | ||||
| } | ||||
|  | ||||
| kickstart.debugging() { | ||||
| kickstart.debugging?() { | ||||
|   set -o | grep xtrace | kickstart.stream.contains on | ||||
| } | ||||
|  | ||||
| kickstart.mute() { | ||||
|   kickstart.info "Running \"$@\"" | ||||
|   if kickstart.debugging; then | ||||
|   if kickstart.debugging?; then | ||||
|     "$@" | ||||
|   else | ||||
|     `"$@" >/dev/null 2>&1` | ||||
|   | ||||
		Reference in New Issue
	
	Block a user