Simplify usage

This commit is contained in:
rany
2021-05-11 16:03:42 +03:00
parent 3f9e86e2c6
commit 0b7308c9a6
3 changed files with 18 additions and 0 deletions

2
.gitignore vendored
View File

@@ -1,4 +1,6 @@
**
!install.sh
!easy-playback.sh
!edge-tts.py
!LICENSE
!sample

7
easy-playback.sh Executable file
View File

@@ -0,0 +1,7 @@
#!/usr/bin/env bash
## To use this script you need to install
## edge-tts.py to a directory in your $PATH
## as executable and give it the name edge-tts
trap 'kill -- $(jobs -p) 2>/dev/null' EXIT
exec {fd}< <(edge-tts "${@}")
mpg123 -C "/dev/fd/$fd"

9
install.sh Executable file
View File

@@ -0,0 +1,9 @@
#!/bin/sh
{ [ -e "edge-tts.py" ] && [ -e "easy-playback.sh" ]; } || { echo "Script needs to be run on root of the repo" >&2; exit 1; }
[ -z "$1" ] && { echo "You need to specify the install path." >&2; exit 1; }
mkdir -p -- "$1" 2>/dev/null
rm -f -- "$1/edge-tts" "$1/easy-playback"
cp -f -- edge-tts.py "$1/edge-tts"
cp -f -- easy-playback.sh "$1/edge-playback"
chmod +x -- "$1/edge-tts" "$1/edge-playback"
exit 0