Skip to content

Commit 4d93d59

Browse files
committed
Update README and check for binaries for bamos#2.
1 parent 0eea7cf commit 4d93d59

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

‎README.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,12 @@ blog's Markdown posts and my project's Markdown README files.
181181
See the [blog post](http://bamos.github.io/2014/12/12/rank-writing/)
182182
for further details.
183183

184+
The following programs should be on your `PATH`:
185+
+ [aspell](http://aspell.net/)
186+
+ [write-good](https://github.com/btford/write-good)
187+
+ [diction](https://www.gnu.org/software/diction/)
188+
189+
184190
```
185191
$ rank-writing.py *.md
186192

‎python3/rank-writing.py‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
import argparse
44
import re
55
from subprocess import Popen,PIPE
6+
import shutil
7+
import sys
68

79
parser = argparse.ArgumentParser()
810
parser.add_argument('--aspell',action='store_true')
@@ -20,6 +22,11 @@
2022
if args.diction: programs.append("diction")
2123
if args.write_good: programs.append("write-good")
2224

25+
for program in programs:
26+
if not shutil.which(program):
27+
print("Error: '{}' not found on PATH. Please install.".format(program))
28+
sys.exit(-1)
29+
2330
def call(cmd,in_f=None):
2431
if in_f:
2532
with open(in_f,'r') as f:

0 commit comments

Comments
 (0)