Implemented scaffolding for BrowserDev tasks and implemented taskGetBrowserDevPassword

This commit is contained in:
Paulo Truta
2024-12-03 09:20:44 +01:00
parent b11034dd17
commit 7e42e72bb2
5 changed files with 90 additions and 0 deletions
+8
View File
@@ -112,6 +112,7 @@ const EdgeAppsPath string = "edgeAppsPath"
const EdgeAppsBackupPath string = "edgeAppsBackupPath"
const WsPath string = "wsPath"
const LoggerPath string = "loggerPath"
const BrowserDevPasswordFileLocation string = "browserDevPasswordFileLocation"
// GetPath : Returns either the hardcoded path, or a overwritten value via .env file at project root. Register paths here for seamless working code between dev and prod environments ;)
@@ -189,6 +190,13 @@ func GetPath(pathKey string) string {
targetPath = "/home/system/components/backups/pw.txt"
}
case BrowserDevPasswordFileLocation:
if env["BROWSERDEV_PASSWORD_FILE_LOCATION"] != "" {
targetPath = env["BROWSERDEV_PASSWORD_FILE_LOCATION"]
} else {
targetPath = "/root/.config/code-server/config.yaml"
}
default:
log.Printf("path_key %s nonexistant in GetPath().\n", pathKey)