mirror of
https://github.com/ZettaIO/restic-compose-backup.git
synced 2025-12-16 10:41:08 +00:00
@@ -82,6 +82,25 @@ def strip_root(path):
|
||||
|
||||
return path
|
||||
|
||||
def format_tags(tags: str, arg = "--tag") -> List[str]:
|
||||
"""
|
||||
Takes a comma separated list of tags.
|
||||
Splits them and appends --tag to each tag.
|
||||
Use the output as the command line argument for the restic cli.
|
||||
Example: foo,bar,test becomes --tag foo --tag bar --tag test
|
||||
"""
|
||||
if not tags:
|
||||
return []
|
||||
|
||||
tags = tags.strip()
|
||||
splitTags = tags.split(",")
|
||||
output = []
|
||||
for tag in splitTags:
|
||||
tag = tag.strip()
|
||||
if tag:
|
||||
output.extend([arg, tag])
|
||||
|
||||
return output
|
||||
|
||||
@contextmanager
|
||||
def environment(name, value):
|
||||
|
||||
Reference in New Issue
Block a user