File: screenshots.bash

package info (click to toggle)
golang-github-cqroot-prompt 0.9.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 356 kB
  • sloc: makefile: 17; sh: 12
file content (17 lines) | stat: -rw-r--r-- 550 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash

SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
ROOT_DIR=$(dirname "$SCRIPT_DIR")

# rm -rf "$ROOT_DIR/screenshots"
mkdir -p "$ROOT_DIR/screenshots"

if [[ "$1" == "-f" ]]; then
	while read -r tapefile; do
		cd "$(dirname "$ROOT_DIR/$tapefile")" && vhs <"$ROOT_DIR/$tapefile"
	done < <(find . -name screenshot.tape)
else
	while read -r tapefile; do
		cd "$(dirname "$ROOT_DIR/$tapefile")" && vhs <"$ROOT_DIR/$tapefile"
	done < <(cd "$ROOT_DIR" && git status -u -s | awk '{print $2}' | grep screenshot.tape)
fi