Chromium Code Reviews| Index: frog/frog.py |
| =================================================================== |
| --- frog/frog.py (revision 1187) |
| +++ frog/frog.py (working copy) |
| @@ -58,7 +58,24 @@ |
| dart = join(os.pardir, dart) |
| return dart |
| +def GetD8(): |
|
ngeoffray
2011/11/04 10:42:21
With frog.py soon to be removed, I don't think it'
|
| + system = utils.GuessOS() |
| + d8 = join(utils.GetBuildRoot(system, 'release', 'ia32'), 'd8') |
| + if exists(d8): return d8 |
| + # Try at the top level |
| + d8 = join(os.pardir, d8) |
| + if exists(d8): return d8 |
| + # Try a debug version |
| + d8 = join(utils.GetBuildRoot(system, 'debug', 'ia32'), 'd8') |
| + if exists(d8): return d8 |
| + # Try at the top level |
| + d8 = join(os.pardir, d8) |
| + return d8 |
| + |
| + |
| +D8 = GetD8() |
| + |
| def execute(cmd): |
| """Execute a command in a subprocess. """ |
| try: |
| @@ -134,8 +151,12 @@ |
| return 1 |
| if subprocess.call("node --help >/dev/null 2>&1", shell=True): |
| - print "Executing node failed. See frog/README.txt for instructions" |
| - return 1 |
| + if not exists(D8): |
| + print "No engine available for running JS code." |
| + print "See frog/README.txt for instructions." |
| + return 1 |
| + elif 'node' in options.js_cmd: |
| + options.js_cmd = D8 |
| return compileAndRun(options, dartArgs, dart) |