Skip to content

Commit

Permalink
Add noexec option
Browse files Browse the repository at this point in the history
  • Loading branch information
agahkarakuzu committed Sep 11, 2024
1 parent c24e695 commit 4f70e4e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
10 changes: 5 additions & 5 deletions myst_libre/tools/build_source_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ def git_clone_repo(self,clone_parent_directory):
self.host_build_source_parent_dir = clone_parent_directory
self.build_dir = os.path.join(self.host_build_source_parent_dir, self.username, self.repo_name, self.gh_repo_commit_hash)
if self.create_build_dir_host():
self.logger.info(f'Cloning into {self.build_dir}')
self.cprint(f'Cloning into {self.build_dir}', "green")
self.repo_object = Repo.clone_from(f'{self.provider}/{self.gh_user_repo_name}', self.build_dir)
else:
self.logger.warning(f'Source {self.build_dir} already exists.')
self.cprint(f'Source {self.build_dir} already exists.', "yellow")
self.repo_object = Repo(self.build_dir)

self.set_commit_info()
Expand All @@ -69,7 +69,7 @@ def git_checkout_commit(self):
Returns:
bool: True if checked out successfully.
"""
self.logger.info(f'Checking out {self.gh_repo_commit_hash}')
self.cprint(f'Checking out {self.gh_repo_commit_hash}', "green")
self.repo_object.git.checkout(self.gh_repo_commit_hash)
return True

Expand All @@ -88,9 +88,9 @@ def get_project_name(self):
def repo2data_download(self,target_directory):
data_req_path = os.path.join(self.build_dir, 'binder', 'data_requirement.json')
if not os.path.isfile(data_req_path):
self.logger.info(f'Skipping repo2data download')
self.cprint(f'Skipping repo2data download', "yellow")
else:
self.logger.info(f'Starting repo2data download')
self.cprint(f'Starting repo2data download', "green")
repo2data = Repo2Data(data_req_path, server=True)
repo2data.set_server_dst_folder(target_directory)
repo2data.install()
Expand Down
11 changes: 11 additions & 0 deletions myst_libre/tools/myst_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,17 @@ def build(self):
self.cprint(f"--> Self env vars {self.env_vars}", "green")
return self.run_command('build', '--execute', '--html',env_vars=self.env_vars)

def build_noexecute(self):
"""
Build the MyST markdown project.
Returns:
str: Command output or None if failed.
"""
os.chdir(self.build_dir)
self.cprint(f"--> Self env vars {self.env_vars}", "green")
return self.run_command('build','--html',env_vars=self.env_vars)

def build_site(self):
"""
Build the MyST markdown project.
Expand Down

0 comments on commit 4f70e4e

Please sign in to comment.