mirror of
https://github.com/YunoHost/package_linter.git
synced 2024-09-03 20:06:12 +02:00
[fix] use 'enumerate' for line_nbr. Relicat.
This commit is contained in:
parent
78661a4c66
commit
6e4fc3ae54
1 changed files with 3 additions and 3 deletions
|
@ -165,15 +165,15 @@ def check_sudo_prefix_commands(script):
|
|||
"service", "yunohost", "find" "swapon", "mkswap", "useradd") # , "dd") cp, mkdir
|
||||
ok = True
|
||||
|
||||
for i in script:
|
||||
for line_nbr, i in enumerate(script):
|
||||
for j in cmd:
|
||||
if j + " " in i and "sudo " + j + " " not in i \
|
||||
and "yunohost service" not in i and "-exec " + j not in i \
|
||||
and ".service" not in i and i[0] != '#':
|
||||
print(c.FAIL + "✘ Line ", i + 1,
|
||||
print(c.FAIL + "✘ Line ", line_nbr + 1,
|
||||
"you should add \"sudo\" before this command line:", c.END)
|
||||
print(" " + i.replace(j,
|
||||
c.BOLD + c.FAIL + cmd[j] + c.END))
|
||||
c.BOLD + c.FAIL + j + c.END))
|
||||
ok = False
|
||||
if ok:
|
||||
print_right("All commands are prefix with \"sudo\".")
|
||||
|
|
Loading…
Reference in a new issue