mirror of
https://github.com/thegeeklab/docker-autotag.git
synced 2024-06-29 12:50:51 +02:00
fix: add stdout as fallback if no out file is defined (#248)
This commit is contained in:
parent
9cc91ca493
commit
7f20729c37
|
@ -3,6 +3,7 @@
|
||||||
import argparse
|
import argparse
|
||||||
import copy
|
import copy
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
|
|
||||||
import semantic_version
|
import semantic_version
|
||||||
|
@ -118,12 +119,15 @@ class Autotag:
|
||||||
v = self._tag_suffix(v, config["suffix"], config["suffix_strict"])
|
v = self._tag_suffix(v, config["suffix"], config["suffix_strict"])
|
||||||
v = self._tag_extra(v, config["extra"])
|
v = self._tag_extra(v, config["extra"])
|
||||||
|
|
||||||
if config["file"]:
|
try:
|
||||||
try:
|
if config["file"]:
|
||||||
with open(config["file"], "w") as f:
|
with open(config["file"], "w") as f:
|
||||||
f.write(",".join(v))
|
f.write(",".join(v))
|
||||||
except OSError as e:
|
else:
|
||||||
self.logger.error(f"Unable to write file: {e!s}")
|
sys.stdout.write(",".join(v))
|
||||||
|
sys.stdout.write("\n")
|
||||||
|
except OSError as e:
|
||||||
|
self.logger.error(f"Unable to write file: {e!s}")
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
|
@ -22,7 +22,7 @@ def trim_prefix(text, prefix):
|
||||||
|
|
||||||
|
|
||||||
def to_prerelease(tup):
|
def to_prerelease(tup):
|
||||||
return "".join(tup)
|
return ".".join(tup)
|
||||||
|
|
||||||
|
|
||||||
class Singleton(type):
|
class Singleton(type):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user