mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
Fix shenanigans with subprocess.Popen and the text argument with rhel
This commit is contained in:
parent
1f1612165a
commit
247cf2b215
4 changed files with 7 additions and 7 deletions
|
|
@ -37,7 +37,7 @@ RUN export MAKEFLAGS="-j$(nproc)" && \
|
|||
|
||||
# Install node and npm to build vite frontend
|
||||
RUN curl -fsSL https://rpm.nodesource.com/setup_20.x | bash - && \
|
||||
dnf install -y --setopt=install_weak_deps=False nodejs
|
||||
dnf install -y --setopt=install_weak_deps=False nodejs
|
||||
|
||||
# Copy files
|
||||
# can't exclude deps from . so we are copying everything by hand
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ RUN export MAKEFLAGS="-j$(nproc)" && \
|
|||
|
||||
# Install node and npm to build vite frontend
|
||||
RUN curl -fsSL https://rpm.nodesource.com/setup_20.x | bash - && \
|
||||
dnf install -y --setopt=install_weak_deps=False nodejs
|
||||
dnf install -y --setopt=install_weak_deps=False nodejs
|
||||
|
||||
# Copy files
|
||||
# can't exclude deps from . so we are copying everything by hand
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ RUN export MAKEFLAGS="-j$(nproc)" && \
|
|||
|
||||
# Install node and npm to build vite frontend
|
||||
RUN curl -fsSL https://rpm.nodesource.com/setup_20.x | bash - && \
|
||||
dnf install -y --setopt=install_weak_deps=False nodejs
|
||||
dnf install -y --setopt=install_weak_deps=False nodejs
|
||||
|
||||
# Copy files
|
||||
# can't exclude deps from . so we are copying everything by hand
|
||||
|
|
|
|||
|
|
@ -46,16 +46,16 @@ def run_command(command: List[str]) -> int:
|
|||
"""Utils to run a subprocess command. This is usefull to run npm commands to build vite project"""
|
||||
print(f"Running command: {command}", flush=True)
|
||||
try:
|
||||
process = Popen(command, stdout=PIPE, stderr=PIPE, cwd=current_directory.as_posix(), shell=not bool(getenv("DOCKERFILE", "")), text=True)
|
||||
process = Popen(command, stdout=PIPE, stderr=PIPE, cwd=current_directory.as_posix(), shell=not bool(getenv("DOCKERFILE", "")))
|
||||
while process.poll() is None:
|
||||
if process.stdout is not None:
|
||||
for line in process.stdout:
|
||||
print(line.strip(), flush=True)
|
||||
print(line.decode("utf-8").strip(), flush=True)
|
||||
|
||||
if process.returncode != 0:
|
||||
print("Error while running command", flush=True)
|
||||
print(process.stdout.read(), flush=True)
|
||||
print(process.stderr.read(), flush=True)
|
||||
print(process.stdout.read().decode("utf-8"), flush=True)
|
||||
print(process.stderr.read().decode("utf-8"), flush=True)
|
||||
return 1
|
||||
except BaseException as e:
|
||||
print(f"Error while running command: {e}", flush=True)
|
||||
|
|
|
|||
Loading…
Reference in a new issue