Skip to content

Commit f22bc71

Browse files
Added -s for supressing BpyBuild output
1 parent c9307eb commit f22bc71

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

bpy_addon_build/args.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,19 @@ class Args:
2626
2727
actions: List[str]
2828
The actions that the user wants to execute
29+
30+
debug_mode: bool
31+
Enable debug logging
32+
33+
supress_messages: bool
34+
Supress BpyBuild output
2935
"""
3036

3137
path: Path = field(default=Path("bpy-build.yaml"))
3238
versions: List[float] = field(default=[])
3339
actions: List[str] = field(default=["default"])
3440
debug_mode: bool = field(default=False)
41+
supress_messages: bool = field(default=False)
3542

3643
@path.validator
3744
def path_validate(self, _: Attribute, value: Path) -> None:
@@ -109,6 +116,13 @@ def parse_args() -> Args:
109116
default=False,
110117
action="store_true",
111118
)
119+
parser.add_argument(
120+
"-s",
121+
"--supress-output",
122+
help="Supress all BpyBuild output except for build actions. This does not apply to debug logs",
123+
default=False,
124+
action="store_true",
125+
)
112126

113127
args: Namespace = parser.parse_args()
114128
config: str = "bpy-build.yaml"
@@ -130,4 +144,5 @@ def parse_args() -> Args:
130144
cast(List[float], args.versions),
131145
cast(List[str], actions),
132146
cast(bool, args.debug_mode),
147+
cast(bool, args.supress_output),
133148
)

bpy_addon_build/build_context.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,10 @@ def install(self, build_path: Path) -> None:
134134
if addon_path.exists():
135135
shutil.rmtree(addon_path)
136136
shutil.unpack_archive(build_path, path)
137-
console.print(f"Installed to {str(path)}", style="green")
137+
if not self.cli.supress_messages:
138+
console.print(f"Installed to {str(path)}", style="green")
138139
installed = True
139-
if not installed:
140+
if not installed and not self.cli.supress_messages:
140141
console.print(f"Cound not find {v}", style="yellow")
141142

142143
def action(self, action: str, folder: Path) -> None:

0 commit comments

Comments
 (0)