diff --git a/cmd/lotus-provider/main.go b/cmd/lotus-provider/main.go index a6c79b6de..24126a8d7 100644 --- a/cmd/lotus-provider/main.go +++ b/cmd/lotus-provider/main.go @@ -10,6 +10,7 @@ import ( "github.com/fatih/color" logging "github.com/ipfs/go-log/v2" + "github.com/mitchellh/go-homedir" "github.com/urfave/cli/v2" "github.com/filecoin-project/lotus/build" @@ -144,8 +145,14 @@ func main() { }, After: func(c *cli.Context) error { if r := recover(); r != nil { + p, err := homedir.Expand(c.String(FlagMinerRepo)) + if err != nil { + log.Errorw("could not expand repo path for panic report", "error", err) + panic(r) + } + // Generate report in LOTUS_PATH and re-raise panic - build.GeneratePanicReport(c.String("panic-reports"), c.String(deps.FlagRepoPath), c.App.Name) + build.GeneratePanicReport(c.String("panic-reports"), p, c.App.Name) panic(r) } return nil diff --git a/journal/fsjournal/fs.go b/journal/fsjournal/fs.go index b2eb946fd..5a74fbfc6 100644 --- a/journal/fsjournal/fs.go +++ b/journal/fsjournal/fs.go @@ -7,6 +7,7 @@ import ( "path/filepath" logging "github.com/ipfs/go-log/v2" + "github.com/mitchellh/go-homedir" "golang.org/x/xerrors" "github.com/filecoin-project/lotus/build" @@ -41,6 +42,11 @@ func OpenFSJournal(lr repo.LockedRepo, disabled journal.DisabledEvents) (journal } func OpenFSJournalPath(path string, disabled journal.DisabledEvents) (journal.Journal, error) { + path, err := homedir.Expand(path) + if err != nil { + return nil, xerrors.Errorf("failed to expand repo path: %w", err) + } + dir := filepath.Join(path, "journal") if err := os.MkdirAll(dir, 0755); err != nil { return nil, fmt.Errorf("failed to mk directory %s for file journal: %w", dir, err) diff --git a/~/.lotus-provider/journal/lotus-journal.ndjson b/~/.lotus-provider/journal/lotus-journal.ndjson deleted file mode 100644 index e69de29bb..000000000