Skip to content

Commit

Permalink
mach commands now warn when it's ambiguous which binary to run
Browse files Browse the repository at this point in the history
Fixes#5080
  • Loading branch information
psdh committed Mar 2, 2015
1 parent fed8787 commit cb6c675
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions python/servo/post_build_commands.py
Expand Up @@ -8,6 +8,7 @@
import SimpleHTTPServer
import SocketServer
import mozdebug
import sys
from shutil import copytree, rmtree, ignore_patterns, copy2

from mach.registrar import Registrar
Expand All @@ -33,8 +34,22 @@ class MachCommands(CommandBase):

def get_binary_path(self, release):
base_path = path.join("components", "servo", "target")
if release:
return path.join(base_path, "release", "servo")
release_path= path.join(base_path, "release", "servo")

if not release:
if not os.path.exists(release_path):
if not os.path.exists(base_path):
print("Servo Binary cannot be found, please run './mach build'"
"and try again!")
sys.exit()
print("Running Debug Build")
return path.join(base_path, "servo")
else:
if os.path.exists(base_path):
print("You have multiple binaries present."
" Please specify which binary is to be run")
sys.exit()
return path.join(release_path, "servo")
return path.join(base_path, "servo")

@Command('run',
Expand Down

5 comments on commit cb6c675

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from mbrubeck
at psdh@cb6c675

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging psdh/servo/improveBinRun = cb6c675 into auto

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

psdh/servo/improveBinRun = cb6c675 merged ok, testing candidate = 801b939

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = 801b939

Please sign in to comment.