Skip to content

Commit 86f61e9

Browse files
committed
Fixed a throw when more than one version is given for a module in cfbs commands
Signed-off-by: jakub-nt <175944085+jakub-nt@users.noreply.github.com>
1 parent 71cef82 commit 86f61e9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cfbs/module.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from collections import OrderedDict
22

33
from cfbs.pretty import pretty
4+
from cfbs.utils import CFBSUserError
45

56

67
def is_module_added_manually(added_by: str):
@@ -24,6 +25,10 @@ def __init__(
2425
"""Initialize from argument with format `NAME[@VERSION]`"""
2526
assert isinstance(arg, str)
2627
if "@" in arg:
28+
if arg.count("@") > 1:
29+
raise CFBSUserError(
30+
"Cannot specify more than one version of the same module"
31+
)
2732
self.name, self.version = arg.split("@")
2833
else:
2934
self.name = arg

0 commit comments

Comments
 (0)