-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRun.sh
More file actions
executable file
·33 lines (27 loc) · 1.26 KB
/
Run.sh
File metadata and controls
executable file
·33 lines (27 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#! /usr/bin/env bash
set -euo pipefail # Putting the script in 'strict mode'
if ! command -v pipenv &>/dev/null ; then
echo "This utillity depends on pipenv, please install it in the enviornment this script is being run on" >&2
exit 1
fi
if ! command -v ffprobe &>/dev/null ; then
echo "This utillity depends on ffprobe, please install it in the enviornment this script is being run on" >&2
exit 1
fi
if ! command -v ffmpeg &>/dev/null ; then
echo "This utillity depends on ffmpeg, please install it in the enviornment this script is being run on" >&2
exit 1
fi
function ScriptSelect
{
# All scripts that end in '.py' are excluded from the selection menu
# The preview window only shows lines that begin with '#' excluding those that begin with '#!'
pipenv run ls ./scripts/ | grep -Gv "[\_\.]py" | fzf --header="Select What You Want to Do" --header-border=bold --header-label-pos=top --no-multi --preview='pyfiglet -w$FZF_PREVIEW_COLUMNS -fansi_regular -jcenter MatStat && grep -G ^#[^!] ./scripts/{}' --preview-window=70%
}
selected=$(ScriptSelect)
while [ "$selected" ]; do
pipenv run python "./scripts/$selected"
read -p "Done with \`$selected\`. Press Enter to continue or Ctrl-c to exit... \
"
selected=$(ScriptSelect)
done