mirror of
https://github.com/dart-lang/sdk
synced 2024-09-15 21:20:36 +00:00
htmlconverter.py: allow .html + .htm file extensions, disallow all others.
Review URL: https://chromereviews.googleplex.com/3567016 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@261 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
parent
8af240c0cc
commit
755cd7ec8b
|
@ -539,14 +539,17 @@ def main():
|
|||
|
||||
try:
|
||||
filename = args[0]
|
||||
extension = filename[filename.rfind('.'):]
|
||||
if extension != '.html' and extension != '.htm':
|
||||
print "Invalid input file extension: %s" % extension
|
||||
return 1
|
||||
outfile = join(options.out, filename)
|
||||
if 'chromium' in options.target:
|
||||
convertForChromium(
|
||||
filename, options.optimize, outfile.replace('.html', '-js.html'),
|
||||
options.verbose)
|
||||
convertForChromium(filename, options.optimize,
|
||||
outfile.replace(extension, '-js' + extension), options.verbose)
|
||||
if 'dartium' in options.target:
|
||||
convertForDartium(filename, outfile.replace('.html', '-dart.html'),
|
||||
options.verbose)
|
||||
convertForDartium(filename,
|
||||
outfile.replace(extension, '-dart' + extension), options.verbose)
|
||||
except Exception as e:
|
||||
print "%sERROR%s: %s" % (RED_COLOR, NO_COLOR, str(e))
|
||||
return 1
|
||||
|
|
Loading…
Reference in a new issue