mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[mod] use subprocess instead of os.system to ensure function has run correctly
This commit is contained in:
parent
51f9dbe5ae
commit
31482e7d31
1 changed files with 3 additions and 2 deletions
|
@ -8,6 +8,7 @@ Pages are stored in OUTPUT_DIR
|
|||
|
||||
import os
|
||||
import yaml
|
||||
import subprocess
|
||||
|
||||
|
||||
THIS_SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
|
@ -22,7 +23,7 @@ if not os.path.exists(OUTPUT_DIR):
|
|||
# man page of yunohost
|
||||
cmd = "sudo help2man \" yunohost \" -o " + OUTPUT_DIR + "yunohost"
|
||||
print(cmd)
|
||||
os.system(cmd)
|
||||
subprocess.check_call(cmd, shell=True)
|
||||
|
||||
# man pages of "yunohost *"
|
||||
with open(ACTIONSMAP_FILE, 'r') as stream:
|
||||
|
@ -41,4 +42,4 @@ with open(ACTIONSMAP_FILE, 'r') as stream:
|
|||
# print("yunohost", domain, action)
|
||||
cmd = "sudo help2man \" yunohost " + domain + " " + action + " --help \" -o " + OUTPUT_DIR + "yunohost_" + domain + "_" + action
|
||||
print(cmd)
|
||||
os.system(cmd)
|
||||
subprocess.check_call(cmd, shell=True)
|
||||
|
|
Loading…
Add table
Reference in a new issue