mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 20:24:09 +00:00
Pick the first extension matched
This commit is contained in:
parent
1f4f0123ed
commit
589e4076dd
@ -93,13 +93,11 @@ def file_passes(filename, refs, regexs):
|
|||||||
else:
|
else:
|
||||||
ref = refs[basename]
|
ref = refs[basename]
|
||||||
|
|
||||||
# remove build tags from the top of Go files
|
# remove extra content from the top of files
|
||||||
if extension == "go" or extension =="generatego":
|
if extension == "go" or extension == "generatego":
|
||||||
p = regexs["go_build_constraints"]
|
p = regexs["go_build_constraints"]
|
||||||
(data, found) = p.subn("", data, 1)
|
(data, found) = p.subn("", data, 1)
|
||||||
|
elif extension == "sh":
|
||||||
# remove shebang from the top of shell files
|
|
||||||
if extension == "sh":
|
|
||||||
p = regexs["shebang"]
|
p = regexs["shebang"]
|
||||||
(data, found) = p.subn("", data, 1)
|
(data, found) = p.subn("", data, 1)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user