Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
Formerly floomhq/moto and earlier buildingopen/moto. Old GitHub URLs redirect.

<p align="center">
<img src="assets/hook-demo.gif" alt="fstack hook demo" width="800">
<img src="assets/hero.gif" alt="fstack hook demo" width="800">
<br>
<em>A safety hook firing on a destructive command. Hero GIF coming soon.</em>
<em>A safety hook firing on a destructive command.</em>
</p>

---
Expand Down
Binary file added assets/hero.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions docs/demos/hero-hook-demo.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env bash
set -euo pipefail

type_slowly() {
local text="$1"
local i

for ((i = 0; i < ${#text}; i++)); do
printf '%s' "${text:i:1}"
sleep 0.045
done
}

printf '%s' '~/projects/api $ '

sleep 1
type_slowly 'rm -rf ~/important-data'

sleep 0.5
printf '\n'

sleep 0.3
printf '\033[31m[fstack hook] BLOCKED: destructive command outside allowlist\033[0m\n'

sleep 0.3
printf '\033[33m reason: rm -rf without explicit --i-know-what-im-doing flag\033[0m\n'

sleep 0.3
printf "\033[32m tip: type 'override' to bypass for this session\033[0m\n"

sleep 0.3
printf '%s' '~/projects/api $ '

sleep 1.5
Loading