Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
beat
beat.cmdline
Commits
9c296a6b
Commit
9c296a6b
authored
Mar 16, 2020
by
Samuel GAIST
Browse files
[commands] Add validation before checking anything else
parent
e68f68d1
Changes
1
Hide whitespace changes
Inline
Side-by-side
beat/cmdline/commands.py
View file @
9c296a6b
...
...
@@ -282,6 +282,12 @@ def push_impl(ctx, names, force, dry_run):
mappings
=
ctx
.
meta
.
get
(
"mappings"
,
{})
for
name
in
names
:
validator
=
common
.
TYPE_VALIDATOR
[
asset_info
.
asset_type
](
config
.
path
,
name
)
if
not
validator
.
valid
:
raise
RuntimeError
(
"Invalid {} {}"
.
format
(
asset_info
.
asset_type
,
validator
.
errors
)
)
with
common
.
Selector
(
config
.
path
)
as
selector
:
dependency_type
=
common
.
TYPE_PLURAL
[
asset_info
.
asset_type
]
fork
=
selector
.
forked_from
(
asset_info
.
asset_type
,
name
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment