Skip to content

Commit

Permalink
add jag script, mv cli to bin directory
Browse files Browse the repository at this point in the history
  • Loading branch information
chee committed Sep 24, 2017
1 parent ec05816 commit 00a94e3
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
File renamed without changes.
22 changes: 22 additions & 0 deletions bin/jag
@@ -0,0 +1,22 @@
#!/bin/bash

term="$1"
reading="$2"

args="$term"

if [ ! -z "$reading" ]; then
args="$args -r $reading"
fi

url="$(ja "$args" | grep [.]ogg$ | head -1)"

if [ ! -z "$url" ] && [ -z "$SAY" ]; then
wget $url -O $term.ogg
else
say -o $term.aiff $term
ffmpeg -i $term.aiff $term.ogg
rm $term.aiff
fi

open -R $term.ogg
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -4,7 +4,7 @@
"description": "get japanese pronunciation audio urls",
"main": "index.js",
"bin": {
"ja": "cli.js"
"ja": "bin/ja.js"
},
"scripts": {
"test": "echo help"
Expand Down

0 comments on commit 00a94e3

Please sign in to comment.