From 146a5fe13cba442afca954733bafd854f4448928 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sat, 12 Dec 2020 10:44:50 +0200 Subject: feat: back up and restore symlinks --- subplot/data.py | 4 ++++ subplot/data.yaml | 3 +++ 2 files changed, 7 insertions(+) (limited to 'subplot') diff --git a/subplot/data.py b/subplot/data.py index 09df6c5..ba3636c 100644 --- a/subplot/data.py +++ b/subplot/data.py @@ -17,6 +17,10 @@ def chmod_file(ctx, filename=None, mode=None): os.chmod(filename, int(mode, 8)) +def create_symlink(ctx, linkname=None, target=None): + os.symlink(linkname, target) + + def create_manifest_of_live(ctx, dirname=None, manifest=None): _create_manifest_of_directory(ctx, dirname=dirname, manifest=manifest) diff --git a/subplot/data.yaml b/subplot/data.yaml index 3b4d938..32c9cd5 100644 --- a/subplot/data.yaml +++ b/subplot/data.yaml @@ -9,6 +9,9 @@ - given: file {filename} has mode {mode} function: chmod_file +- given: symbolink link {linkname} that points at {target} + function: create_symlink + - given: a manifest of the directory {dirname} in {manifest} function: create_manifest_of_live -- cgit v1.2.1