mirror of
https://github.com/bjoernellens1/cps_loki.git
synced 2025-01-19 08:16:59 +00:00
Update initialize.py
This commit is contained in:
parent
c42f5a6adb
commit
8745134893
@ -5,6 +5,7 @@ import yaml
|
|||||||
class GitCloner:
|
class GitCloner:
|
||||||
def __init__(self, directory):
|
def __init__(self, directory):
|
||||||
self.directory = directory
|
self.directory = directory
|
||||||
|
self.maindir = os.path.dirname(os.path.abspath(__file__)) # should be equal to the current directory where the script is called from
|
||||||
|
|
||||||
def clone_or_update_repo(self, repo_url, branch='main'):
|
def clone_or_update_repo(self, repo_url, branch='main'):
|
||||||
repo_name = repo_url.split('/')[-1].split('.')[0]
|
repo_name = repo_url.split('/')[-1].split('.')[0]
|
||||||
@ -36,7 +37,8 @@ class GitCloner:
|
|||||||
# Build the repository using colcon
|
# Build the repository using colcon
|
||||||
try:
|
try:
|
||||||
# Change working directory to the base directory
|
# Change working directory to the base directory
|
||||||
os.chdir('.')
|
main_dir = os.path.join(self.maindir)
|
||||||
|
os.chdir(maindir)
|
||||||
|
|
||||||
# Execute colcon build
|
# Execute colcon build
|
||||||
subprocess.check_output(['colcon', 'build'])
|
subprocess.check_output(['colcon', 'build'])
|
||||||
|
Loading…
Reference in New Issue
Block a user