Skip to content

Commit

Permalink
Bump validate.py to Python 3
Browse files Browse the repository at this point in the history
  • Loading branch information
rasa committed Jun 20, 2019
1 parent 5f29c9b commit cc44552
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion validate.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ for %%i in (%_1%) do (
if exist "%%~i.failed" (
del "%%~i.failed"
)
py -2 %~dp0\validate.py "%%~i"
py -3 %~dp0\validate.py "%%~i"
)
exit /b 0
19 changes: 16 additions & 3 deletions validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,24 @@ def decode(s):
return s.decode('latin-1')


schema_name = 'D:/github/rasa/scoop/schema.json'
schema_name = 'c:/scoop/apps/scoop/current/schema.json'

if not os.path.isfile(schema_name):
schema_name = '%s/scoop/apps/scoop/current/schema.json' % os.environ[
'USERPROFILE']
if 'SCOOP_HOME' in os.environ:
schema_name = '%s/schema.json' % os.environ['SCOOP_HOME']

if not os.path.isfile(schema_name):
if 'SCOOP' in os.environ:
schema_name = '%s/apps/scoop/current/schema.json' % os.environ['SCOOP']

if not os.path.isfile(schema_name):
if 'USERPROFILE' in os.environ:
schema_name = '%s/scoop/apps/scoop/current/schema.json' % os.environ[
'USERPROFILE']

if not os.path.isfile(schema_name):
print("File not found: schema.json")
sys.exit(1)

file = sys.argv[1]
if re.match('^schema', file):
Expand Down

0 comments on commit cc44552

Please sign in to comment.