mirror of
https://github.com/flibusta-apps/library_updater.git
synced 2025-12-06 15:45:36 +01:00
Update tasks
This commit is contained in:
11
src/app/services/updaters/utils/cmd.py
Normal file
11
src/app/services/updaters/utils/cmd.py
Normal file
@@ -0,0 +1,11 @@
|
||||
import asyncio
|
||||
from typing import Optional
|
||||
|
||||
|
||||
async def run_cmd(cmd: str) -> tuple[bytes, bytes, Optional[int]]:
|
||||
proc = await asyncio.create_subprocess_shell(
|
||||
cmd, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE
|
||||
)
|
||||
|
||||
stdout, stderr = await proc.communicate()
|
||||
return stdout, stderr, proc.returncode
|
||||
Reference in New Issue
Block a user