Skip to content

Commit

Permalink
Change is_file check to accept named pipes
Browse files Browse the repository at this point in the history
Fix issue #26
  • Loading branch information
noahmorrison committed Apr 20, 2018
1 parent b818c90 commit 8dbc2cb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions chevron/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ def cli_main():
import argparse
import os

def is_file(arg):
if not os.path.isfile(arg):
def is_file_or_pipe(arg):
if not os.path.exists(arg) or os.path.isdir(arg):
parser.error('The file {0} does not exist!'.format(arg))
else:
return arg
Expand All @@ -50,11 +50,11 @@ def is_dir(arg):
version='0.8.4')

parser.add_argument('template', help='The mustache file',
type=is_file)
type=is_file_or_pipe)

parser.add_argument('-d', '--data', dest='data',
help='The json data file',
type=is_file, default={})
type=is_file_or_pipe, default={})

parser.add_argument('-p', '--path', dest='partials_path',
help='The directory where your partials reside',
Expand Down

0 comments on commit 8dbc2cb

Please sign in to comment.