Skip to content

Commit

Permalink
Revive generateScreenshots.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
banga committed Dec 29, 2023
1 parent 66a3acf commit fc8b091
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions scripts/generateScreenshots.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
#!/bin/sh

set -e

rows=$(tput lines)
window_id=$(osascript -e 'tell app "iTerm" to id of window 1')
window_id=$(osascript -e 'tell app "iTerm" to id of window 1')

for theme in "$@"
do
npm run build:publish

for theme in "$@"; do
git config --replace-all split-diffs.theme-name "$theme"
clear
git --no-pager show 5a00d16095a255b57c762289fa434e18088b956b src/iterSideBySideDiffs.ts | ./bin/git-split-diffs --color | head -n $(($rows-1))
screencapture -x -T 1 -l $window_id "screenshots/$theme.png"
git --no-pager show 5a00d16095a255b57c762289fa434e18088b956b src/iterSideBySideDiffs.ts | node ./build/index.mjs --color | head -n $((rows - 1))
screencapture -x -T 1 -l "$window_id" "screenshots/$theme.png"
open -a ImageOptim "screenshots/$theme.png"
done

git config --unset split-diffs.theme-name

0 comments on commit fc8b091

Please sign in to comment.