Skip to content

Commit

Permalink
feat: add a plaform ros run script
Browse files Browse the repository at this point in the history
  • Loading branch information
MrBlenny committed Dec 12, 2023
1 parent 0369483 commit c4bfbed
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions platform_cli/groups/ros.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,31 @@ def command():

command()

@ros.command(name="run")
@click.option(
"--watch", type=bool, is_flag=True, default=False, help="Should we watch for changes?"
)
@click.option(
"--build",
type=bool,
is_flag=True,
default=False,
help="Should we build before launching?",
)
@click.argument("args", nargs=-1)
def run(watch: bool, build: bool, args: List[str]): # type: ignore
"""Runs a script after building the ROS packages"""

def command():
if build:
call("platform ros build")
return call(" ".join(args), process=watch)

if watch:
return start_watcher(command)

command()

@ros.command(name="install_poetry_deps")
@click.option("--base-path", type=str, help="The path to where the packages are installed")
def install_poetry_deps(base_path: Path): # type: ignore
Expand Down

0 comments on commit c4bfbed

Please sign in to comment.