Fix in shell_command for get return code
This commit is contained in:
parent
ac09f67cde
commit
dfadd0b433
2 changed files with 6 additions and 4 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/epython3
|
#!/usr/bin/python3
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import distro
|
import distro
|
||||||
|
|
@ -8,8 +8,10 @@ import json
|
||||||
|
|
||||||
def shell_command(command):
|
def shell_command(command):
|
||||||
|
|
||||||
if call(command, shell=True) > 0:
|
return_call=call(command, shell=True)
|
||||||
print('Error: cannot execute command '+command+"\n\n")
|
|
||||||
|
if return_call> 0:
|
||||||
|
print('Error: cannot execute command '+command+' with return code '+str(return_call)+'\n\n"')
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
return True
|
return True
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ build-backend = "flit_core.buildapi"
|
||||||
name = "pastafariutils"
|
name = "pastafariutils"
|
||||||
authors = [{name = "Antonio de la Rosa", email = "antonio.delarosa@salirdelhoyo.com"}]
|
authors = [{name = "Antonio de la Rosa", email = "antonio.delarosa@salirdelhoyo.com"}]
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
version = "0.76.1"
|
version = "0.76.2"
|
||||||
description = "Utils for make *nix scripts."
|
description = "Utils for make *nix scripts."
|
||||||
# dynamic = ["version", "description"]
|
# dynamic = ["version", "description"]
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue