From 50fa87d6dff8d7a17d9d48740e3ee4ee4af59c3c Mon Sep 17 00:00:00 2001 From: prash3r Date: Sat, 24 Sep 2022 21:55:36 +0200 Subject: [PATCH] repairs plugin creation inside the devcontainer strange windows volume behaviour needs a small delay between template folder unzip and rename. reverts user changes of the dev container which werent the cause of this problem. --- .devcontainer/devcontainer.json | 2 +- cbpi/cli.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index ae59030..08f216c 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -47,5 +47,5 @@ //"postCreateCommand": "pip3 install -r ./requirements.txt", // Uncomment to connect as a non-root user if you've added one. See https://aka.ms/vscode-remote/containers/non-root. - // "remoteUser": "vscode" + "remoteUser": "vscode" } diff --git a/cbpi/cli.py b/cbpi/cli.py index fcec9de..bc3b13d 100644 --- a/cbpi/cli.py +++ b/cbpi/cli.py @@ -17,6 +17,7 @@ from importlib_metadata import metadata from tabulate import tabulate from PyInquirer import prompt, print_json import platform +import time class CraftBeerPiCli(): def __init__(self, config) -> None: @@ -99,8 +100,10 @@ class CraftBeerPiCli(): with ZipFile('temp.zip', 'r') as repo_zip: repo_zip.extractall() + + time.sleep(1) # windows dev container permissions problem otherwise - os.rename("./craftbeerpi4-plugin-template-main", os.path.join(".", name)) + os.rename(os.path.join(".","craftbeerpi4-plugin-template-main"), os.path.join(".", name)) os.rename(os.path.join(".", name, "src"), os.path.join(".", name, name)) import jinja2