From e9bf7245bbae90020092d9ecb323b4ccb7a0788c Mon Sep 17 00:00:00 2001 From: Stephen Kirby Date: Thu, 5 Oct 2023 22:27:00 +0000 Subject: [PATCH] fixed sh ref --- filebrowser/main.test.ts | 14 ++++++++++++++ filebrowser/main.tf | 3 +-- filebrowser/run.sh | 4 +--- 3 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 filebrowser/main.test.ts diff --git a/filebrowser/main.test.ts b/filebrowser/main.test.ts new file mode 100644 index 0000000..9d6cd11 --- /dev/null +++ b/filebrowser/main.test.ts @@ -0,0 +1,14 @@ +import { describe, expect, it } from "bun:test"; +import { + executeScriptInContainer, + runTerraformApply, + runTerraformInit, + testRequiredVariables, +} from "../test"; + +describe("azure-region", async () => { + await runTerraformInit(import.meta.dir); + + testRequiredVariables(import.meta.dir, {}); + +}); diff --git a/filebrowser/main.tf b/filebrowser/main.tf index 1eb4a90..f479488 100644 --- a/filebrowser/main.tf +++ b/filebrowser/main.tf @@ -9,7 +9,6 @@ terraform { } } -# Add required variables for your modules and remove any unneeded variables variable "agent_id" { type = string description = "The ID of a Coder agent." @@ -20,7 +19,7 @@ variable "database_path" { description = "The path to the filebrowser database." default = "filebrowser.db" validation { - # condition = endswith(var.database_path, "filebrowser.db") + # Ensures path leads to */filebrowser.db condition = can(regex(".*filebrowser\\.db$", var.database_path)) error_message = "The database_path must end with 'filebrowser.db'." } diff --git a/filebrowser/run.sh b/filebrowser/run.sh index 3735efa..bb93300 100644 --- a/filebrowser/run.sh +++ b/filebrowser/run.sh @@ -12,10 +12,8 @@ printf "👷 Starting filebrowser in background... \n\n" ROOT_DIR=${FOLDER} ROOT_DIR=$${ROOT_DIR/\~/$HOME} -# Set the database flag if DB_PATH is set DB_FLAG="" if [ "${DB_PATH}" != "filebrowser.db" ]; then - echo ">>> flag set!" DB_FLAG="-d ${DB_PATH}" fi @@ -23,6 +21,6 @@ printf "📂 Serving $${ROOT_DIR} at http://localhost:${PORT} \n\n" printf "Running 'filebrowser --noauth --root $ROOT_DIR --port ${PORT}$${DB_FLAG}' \n\n" # -d ${DB_PATH} -filebrowser --noauth --root $ROOT_DIR --port ${PORT}${DB_FLAG} >${LOG_PATH} 2>&1 & # -d ${DB_PATH} +filebrowser --noauth --root $ROOT_DIR --port ${PORT}$${DB_FLAG} >${LOG_PATH} 2>&1 & # -d ${DB_PATH} printf "📝 Logs at ${LOG_PATH} \n\n"