mirror of
https://github.com/PiBrewing/craftbeerpi4.git
synced 2024-12-23 22:14:56 +01:00
keeps default dev config unchanged.
this commit moves the default config into a seperate folder. And it adds a preLaunchTask which copies the default dev config to the used dev config. This is done with the cp option '-ru' so if the files in the target dir (current config) are newer they are not overwritten.
This commit is contained in:
parent
f924e1a683
commit
706bbac9f0
17 changed files with 24 additions and 2 deletions
3
.vscode/launch.json
vendored
3
.vscode/launch.json
vendored
|
@ -10,7 +10,8 @@
|
|||
"type": "python",
|
||||
"request": "launch",
|
||||
"module": "run",
|
||||
"args": ["--config-folder-path=./.devcontainer/cbpi-dev-config", "start"]
|
||||
"args": ["--config-folder-path=./.devcontainer/cbpi-dev-config", "start"],
|
||||
"preLaunchTask": "copy default cbpi config files if dev config files dont exist"
|
||||
},
|
||||
|
||||
{
|
||||
|
|
20
.vscode/tasks.json
vendored
Normal file
20
.vscode/tasks.json
vendored
Normal file
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
// See https://go.microsoft.com/fwlink/?LinkId=733558
|
||||
// for the documentation about the tasks.json format
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"label": "copy default cbpi config files if dev config files dont exist",
|
||||
"type": "shell",
|
||||
"command": "cp -ru ${workspaceFolder}/.devcontainer/cbpi-default-dev-config/. ${workspaceFolder}/.devcontainer/cbpi-dev-config",
|
||||
"windows": {
|
||||
"command": "echo 'this pre debug task should only be run inside the docker dev container - doing nothing instead'"
|
||||
},
|
||||
"group": "build",
|
||||
"presentation": {
|
||||
"reveal": "silent",
|
||||
"panel": "shared"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -14,7 +14,8 @@ class ConfigFolder:
|
|||
def __init__(self, configFolderPath, logsFolderPath):
|
||||
self.configFolderPath = configFolderPath
|
||||
self.logsFolderPath = logsFolderPath
|
||||
self.logger.info("Config folder path : " + os.path.join(Path(self.cbpi.config_folder.configFolderPath).absolute()))
|
||||
print("config folder path : " + configFolderPath)
|
||||
print("logs folder path : " + logsFolderPath)
|
||||
|
||||
def config_file_exists(self, path):
|
||||
return os.path.exists(self.get_file_path(path))
|
||||
|
|
Loading…
Reference in a new issue