Skip to content

Commit

Permalink
Merge pull request #451 from kindlyops/data-dir
Browse files Browse the repository at this point in the history
set pocketbase data dir
  • Loading branch information
statik authored Sep 24, 2022
2 parents 40966a1 + 7cf00ec commit 16775c8
Show file tree
Hide file tree
Showing 10 changed files with 708 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: shellcheck
uses: reviewdog/action-shellcheck@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
github_token: ${{ secrets.GORELEASER_GITHUB_TOKEN }}
reporter: github-pr-review # Change reporter.
path: "." # Optional.
pattern: "*.sh" # Optional.
Expand All @@ -33,7 +33,7 @@ jobs:
uses: reviewdog/action-golangci-lint@v2
with:
reporter: github-pr-review
github_token: ${{ secrets.GITHUB_TOKEN }}
github_token: ${{ secrets.GORELEASER_GITHUB_TOKEN }}
golangci_lint_flags: "--config=.golangci.yml"
verify-labels:
name: verify labels
Expand Down
17 changes: 16 additions & 1 deletion cmd/fly.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
package cmd

import (
"os"
"path/filepath"

"github.com/muesli/coral"
"github.com/pocketbase/pocketbase"
"github.com/rs/zerolog/log"
Expand All @@ -32,8 +35,20 @@ var flyServerCmd = &coral.Command{
func flyServer(cmd *coral.Command, args []string) {
_ = "127.0.0.1:" + viper.GetString("port")

configDir, err := os.UserConfigDir()
if err != nil {
log.Fatal().Stack().Err(err).Msg("Couldn't locate config dir")
}

configDir = filepath.Join(configDir, "vbs")

os.MkdirAll(configDir, os.ModePerm)

log.Debug().Msgf("running pocketbase\n")
app := pocketbase.New()
app := pocketbase.NewWithConfig(pocketbase.Config{
DefaultDataDir: configDir,
})

if err := app.Start(); err != nil {
log.Fatal().Err(err).Msg("error starting pocketbase")
}
Expand Down

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 16775c8

Please sign in to comment.