diff --git a/plugins-available/content-command.sh b/plugins-available/content-command.sh new file mode 100644 index 0000000..e7a9a27 --- /dev/null +++ b/plugins-available/content-command.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# Add a content line by decorating the input with triple backticks ``` +PLUGIN_CONTENT+=( hookContentCmd ) +hookContentCmd(){ + [[ -z "$1" ]] && echo "Add a shell command line" && return + TMP="$1" + read -e -p "Command line? " CMD + [[ -z "$CMD" ]] && panic "Not a valid content" && return + echo "\`\`\`$CMD\`\`\`" >> $TMP +} +