diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 08f216c..ae59030 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/.gitignore b/.gitignore index 20ad518..32b01ba 100644 --- a/.gitignore +++ b/.gitignore @@ -18,4 +18,6 @@ node_modules config/* logs/ .coverage -.devcontainer/cbpi-dev-config/* \ No newline at end of file +.devcontainer/cbpi-dev-config/* +cbpi4-* +temp* \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json index a3c07c1..1dd8992 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -14,6 +14,14 @@ "preLaunchTask": "copy default cbpi config files if dev config files dont exist" }, + { + "name": "create CraftBeerPi4 plugin", + "type": "python", + "request": "launch", + "module": "run", + "args": ["--config-folder-path=./.devcontainer/cbpi-dev-config", "create"] + }, + { "name": "setup CraftBeerPi4: create config folder structure", "type": "python", diff --git a/cbpi/cli.py b/cbpi/cli.py index 1496764..fcec9de 100644 --- a/cbpi/cli.py +++ b/cbpi/cli.py @@ -87,7 +87,7 @@ class CraftBeerPiCli(): answers = prompt(questions) - name = "cbpi4_" + answers["name"] + name = "cbpi4-" + str(answers["name"]).replace('_', '-').replace(' ', '-') if os.path.exists(os.path.join(".", name)) is True: print("Cant create Plugin. Folder {} already exists ".format(name)) return diff --git a/cbpi/configFolder.py b/cbpi/configFolder.py index 88ee8b8..954f1a3 100644 --- a/cbpi/configFolder.py +++ b/cbpi/configFolder.py @@ -97,6 +97,7 @@ class ConfigFolder: ['dashboard/widgets', 'folder'], ['dashboard', 'folder'], ['fermenterrecipes', 'folder'], + [self.logsFolderPath, 'folder'], ['recipes', 'folder'], ['upload', 'folder'] ] @@ -172,6 +173,7 @@ class ConfigFolder: def create_folders(self): pathlib.Path(self.configFolderPath).mkdir(parents=True, exist_ok=True) + pathlib.Path(self.logsFolderPath).mkdir(parents=True, exist_ok=True) pathlib.Path(os.path.join(self.configFolderPath, 'dashboard', 'widgets')).mkdir(parents=True, exist_ok=True) pathlib.Path(os.path.join(self.configFolderPath, 'recipes')).mkdir(parents=True, exist_ok=True) pathlib.Path(os.path.join(self.configFolderPath, 'fermenterrecipes')).mkdir(parents=True, exist_ok=True)