File tree 1 file changed +11
-6
lines changed
1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -100,12 +100,17 @@ def _set_default_verify_subparser(parser: argparse.ArgumentParser, name: str) ->
100
100
if sp_name in sys .argv [1 :]:
101
101
subparser_found = True
102
102
if not subparser_found :
103
- # If `sigstore verify identity` wasn't passed explicitly, we need
104
- # to insert the `identity` subcommand into the correct position
105
- # within `sys.argv`. To do that, we get the index of the `verify`
106
- # subcommand, and insert it directly after it.
107
- verify_idx = sys .argv .index ("verify" )
108
- sys .argv .insert (verify_idx + 1 , name )
103
+ try :
104
+ # If `sigstore verify identity` wasn't passed explicitly, we need
105
+ # to insert the `identity` subcommand into the correct position
106
+ # within `sys.argv`. To do that, we get the index of the `verify`
107
+ # subcommand, and insert it directly after it.
108
+ verify_idx = sys .argv .index ("verify" )
109
+ sys .argv .insert (verify_idx + 1 , name )
110
+ except ValueError :
111
+ # This happens when we invoke `sigstore sign`, since there's no
112
+ # `verify` subcommand to insert under. We do nothing in this case.
113
+ pass
109
114
110
115
111
116
def _add_shared_instance_options (group : argparse ._ArgumentGroup ) -> None :
You can’t perform that action at this time.
0 commit comments