(cmd)
| 134 | |
| 135 | |
| 136 | def command_exists(cmd): |
| 137 | if sys.platform == "win32": |
| 138 | safe_cmd = shlex.split(f'{cmd}') |
| 139 | result = subprocess.Popen(safe_cmd, stdout=subprocess.PIPE) |
| 140 | return result.wait() == 1 |
| 141 | else: |
| 142 | safe_cmd = shlex.split(f"bash -c type {cmd}") |
| 143 | result = subprocess.Popen(safe_cmd, stdout=subprocess.PIPE) |
| 144 | return result.wait() == 0 |
| 145 | |
| 146 | |
| 147 | def op_envvar(op_name): |