diff options
author | Munyoki Kilyungi | 2024-04-17 15:57:19 +0300 |
---|---|---|
committer | BonfaceKilz | 2024-04-30 13:09:46 +0300 |
commit | 8aee04b702a947579202d00540d262b1be1e68d5 (patch) | |
tree | e5bdecc11a7a7ded4495c5653fd45507c7f44537 /gn2 | |
parent | 378a7793aee7beac5e74f5265a014fa4f9e731fa (diff) | |
download | genenetwork2-8aee04b702a947579202d00540d262b1be1e68d5.tar.gz |
Delete function for saving metadata.
* gn2/wqflask/edit.py (save_dataset_metadata): Delete.
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
Diffstat (limited to 'gn2')
-rw-r--r-- | gn2/wqflask/edit.py | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/gn2/wqflask/edit.py b/gn2/wqflask/edit.py index e7a58bc0..964b2fdb 100644 --- a/gn2/wqflask/edit.py +++ b/gn2/wqflask/edit.py @@ -45,35 +45,6 @@ def __run_cmd__(cmd) -> Either: return Right(_result.stdout) -def save_dataset_metadata( - git_dir: str, output: str, - author: str, content: str, msg: str -) -> Either: - """Save dataset metadata to git""" - def __write__(): - try: - with Path(output).open(mode="w") as f_: - f_.write(content) - return Right(0) - except Exception as e_: - return Left({ - "command": "Writing to File", - "error": str(e_) - }) - - return ( - __run_cmd__(f"git -C {git_dir} reset --hard origin".split(" ")) - .then(lambda _: __run_cmd__(f"git -C {git_dir} pull".split(" "))) - .then(lambda _: __write__()) - .then(lambda _: __run_cmd__(f"git -C {git_dir} add .".split(" "))) - .then(lambda _: __run_cmd__( - f"git -C {git_dir} commit -m".split(" ") + [ - f'{msg}', f"--author='{author}'", "--no-gpg-sign" - ])) - .then(lambda _: __run_cmd__(f"git -C {git_dir} \ -push origin master --dry-run".split(" ")))) - - @metadata.route("/edit") @require_oauth2_edit_resource_access @require_oauth2 |