Skip to content

Commit

Permalink
Show last command in debug output
Browse files Browse the repository at this point in the history
  • Loading branch information
Staubgeborener authored Sep 13, 2024
1 parent 18a94c8 commit f7bb520
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,15 @@ if [[ ! -v backupPaths ]]; then
fi
fi

# Debug output: .env file with hidden token
if [ "$debug_output" = true ]; then
# Debug output: Show last command
begin_debug_line
if [[ "$SHELL" == */bash* ]]; then
echo -n "Command: " && tail -n 3 ~/.bash_history | head -n 1
fi
end_debug_line

# Debug output: .env file with hidden token
begin_debug_line
while IFS= read -r line; do
if [[ $line == github_token=* ]]; then
Expand All @@ -94,6 +101,7 @@ if [ "$debug_output" = true ]; then
done < $HOME/klipper-backup/.env
end_debug_line

# Debug output: Check git repo
if [[ $git_host == "github.com" ]]; then
begin_debug_line
if curl -fsS "https://api.github.com/repos/${github_username}/${github_repository}" >/dev/null; then
Expand Down

0 comments on commit f7bb520

Please sign in to comment.