diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index c504686a..ff6ea28d 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -13,26 +13,26 @@ jobs: lint-frontend: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: '18' - run: make lint-frontend lint-backend: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-go@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: go-version: 1.21.0 - run: make lint-backend lint-commits: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: actions/setup-node@v2 + - uses: actions/setup-node@v4 with: node-version: '18' - run: make lint-commits @@ -46,16 +46,16 @@ jobs: test-frontend: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: '18' - run: make test-frontend test-backend: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-go@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: go-version: 1.21.0 - run: make test-backend @@ -71,13 +71,13 @@ jobs: needs: [lint, test] if: startsWith(github.event.ref, 'refs/tags/v') steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: actions/setup-go@v2 + - uses: actions/setup-go@v5 with: go-version: 1.21.0 - - uses: actions/setup-node@v2 + - uses: actions/setup-node@v4 with: node-version: '18' - name: Set up QEMU diff --git a/cmd/utils.go b/cmd/utils.go index 2bd9e760..d4ccbacc 100644 --- a/cmd/utils.go +++ b/cmd/utils.go @@ -87,16 +87,23 @@ func python(fn pythonFunc, cfg pythonConfig) cobraFunc { data := pythonData{hadDB: true} path := getParam(cmd.Flags(), "database") + absPath, err := filepath.Abs(path) + if err != nil { + panic(err) + } exists, err := dbExists(path) if err != nil { panic(err) } else if exists && cfg.noDB { - log.Fatal(path + " already exists") + log.Fatal(absPath + " already exists") } else if !exists && !cfg.noDB && !cfg.allowNoDB { - log.Fatal(path + " does not exist. Please run 'filebrowser config init' first.") + log.Fatal(absPath + " does not exist. Please run 'filebrowser config init' first.") + } else if !exists && !cfg.noDB { + log.Println("Warning: filebrowser.db can't be found. Initialing in " + strings.TrimSuffix(absPath, "filebrowser.db")) } + log.Println("Using database: " + absPath) data.hadDB = exists db, err := storm.Open(path) checkErr(err) diff --git a/frontend/public/index.html b/frontend/public/index.html index 39d926d8..530da7cf 100644 --- a/frontend/public/index.html +++ b/frontend/public/index.html @@ -16,6 +16,8 @@ [{[ if .Name -]}][{[ .Name ]}][{[ else ]}]File Browser[{[ end ]}] + +