mirror of
https://github.com/PiBrewing/craftbeerpi4.git
synced 2024-11-21 14:38:15 +01:00
adds the 'cbpi create' command to vscode.
also initilizes plugin names with dashes instead of underscores. everything now runs as root inside the dev container (otherwise the permissions for cbpi create wouldnt be sufficient).
This commit is contained in:
parent
ac9b599619
commit
1fa3f88997
5 changed files with 15 additions and 3 deletions
|
@ -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"
|
||||
}
|
||||
|
|
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -18,4 +18,6 @@ node_modules
|
|||
config/*
|
||||
logs/
|
||||
.coverage
|
||||
.devcontainer/cbpi-dev-config/*
|
||||
.devcontainer/cbpi-dev-config/*
|
||||
cbpi4-*
|
||||
temp*
|
8
.vscode/launch.json
vendored
8
.vscode/launch.json
vendored
|
@ -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",
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue