Skip to content

Instantly share code, notes, and snippets.

@zachriggle

zachriggle/x Secret

Created August 23, 2021 16:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zachriggle/eedbfebee870bf66bfafcc2f78b2da78 to your computer and use it in GitHub Desktop.
Save zachriggle/eedbfebee870bf66bfafcc2f78b2da78 to your computer and use it in GitHub Desktop.
#!/usr/bin/env zsh
local -a _to_source=( ${@[1,-1]} )
local _blacklisted_paths="${(j:|:)fpath}|${0:A}"
TRAPDEBUG() {
local trace=$funcfiletrace[1]
local file=${trace%%:*}
file=${file:A}
if [[ "$file" =~ "$_blacklisted_paths" ]]; then
return
fi
local first_line=$(head -1 <<<$ZSH_DEBUG_CMD)
# local first_line=${ZSH_DEBUG_CMD:%%\n}
command echo $'\n$' "$first_line"
}
() {
source "${_to_source[@]}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment