diff --git a/miniogre/actions.py b/miniogre/actions.py index e17e01a..e4f6265 100644 --- a/miniogre/actions.py +++ b/miniogre/actions.py @@ -445,7 +445,7 @@ def spin_up_container(image_name, project_path, port): return 0 -def create_sbom(image_name, project_path, format): +def create_sbom(image_name, project_path, format, verbose = False): # Create SBOM from inside the container print(emoji.emojize(':desktop_computer: Generating SBOM...')) @@ -461,9 +461,12 @@ def create_sbom(image_name, project_path, format): sbom_cmd = ( " docker run -d --rm -v {}:/opt/{} --name {}_sbom {} bash -c '{}; wait'".format(project_path, project_name, container_name, image_name, sbom_format_cmd) ) - - print(sbom_cmd) - p = subprocess.Popen(sbom_cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) + if verbose: + stderr = None + print(sbom_cmd) + else: + stderr = subprocess.PIPE + p = subprocess.Popen(sbom_cmd, stdout=subprocess.PIPE, stderr=stderr, shell=True) p.communicate() p.wait() diff --git a/miniogre/main.py b/miniogre/main.py index 19dda00..affa322 100644 --- a/miniogre/main.py +++ b/miniogre/main.py @@ -47,6 +47,7 @@ def run(provider: str = 'openai', dry: bool = False, force_requirements_generation: bool = True, sbom_format: str = 'pip-licenses', + no_container: bool = False, verbose: bool = False): """ Run miniogre @@ -74,9 +75,10 @@ def run(provider: str = 'openai', config_bashrc(project_path, ogre_dir_path, None, None, None) config_dockerfile(project_path, project_name, ogre_dir_path, baseimage, dry) build_docker_image(os.path.join(ogre_dir_path, "Dockerfile"), project_name, verbose) - create_sbom(project_name, project_path, sbom_format) + create_sbom(project_name, project_path, sbom_format, verbose) end_emoji() - spin_up_container(project_name, project_path, port) + if no_container == False: + spin_up_container(project_name, project_path, port) if __name__ == '__main__': app() \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 9ebf4f6..1ee2bdb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "miniogre" -version = "0.4.0" +version = "0.4.1" description = "miniogre: automate the installation of Python dependencies with AI, to ensure your code runs on any computer" readme = "README.md" authors = ["Wilder Lopes "]