mirror of
https://github.com/containers/podman-compose.git
synced 2025-05-30 23:16:40 +02:00
Add ability to input docker-compose.yaml via stdin
Signed-off-by: Artho Pacini <eu@arthopacini.com>
This commit is contained in:
parent
14f39e5b86
commit
3359380ec6
@ -1762,7 +1762,7 @@ class PodmanCompose:
|
||||
"pass files with -f"
|
||||
)
|
||||
sys.exit(-1)
|
||||
ex = map(os.path.exists, files)
|
||||
ex = map(lambda x: x == '-' or os.path.exists(x), files)
|
||||
missing = [fn0 for ex0, fn0 in zip(ex, files) if not ex0]
|
||||
if missing:
|
||||
log.fatal("missing files: %s", missing)
|
||||
@ -1811,6 +1811,9 @@ class PodmanCompose:
|
||||
except StopIteration:
|
||||
break
|
||||
|
||||
if filename.strip().split('/')[-1] == '-':
|
||||
content = yaml.safe_load(sys.stdin)
|
||||
else:
|
||||
with open(filename, "r", encoding="utf-8") as f:
|
||||
content = yaml.safe_load(f)
|
||||
# log(filename, json.dumps(content, indent = 2))
|
||||
|
Loading…
x
Reference in New Issue
Block a user