Skip to content

Commit

Permalink
Create file dir if it doesn't exist (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
danyalprout authored Oct 9, 2024
1 parent 6f21e2e commit c640859
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions op-da/da/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"fmt"
"net/url"
"os"
"strings"
"sync/atomic"

Expand Down Expand Up @@ -70,6 +71,10 @@ func newStore(cfg *CLIConfig) (altda.KVStore, error) {
split := strings.SplitN(u.Path, "/", 2)
return NewS3store(split[0], split[1]), nil
case "file":
err = os.MkdirAll(u.Path, os.FileMode(0755))
if err != nil {
return nil, fmt.Errorf("failed to create directory: %w", err)
}
return NewFilestore(u.Path), nil
default:
return nil, fmt.Errorf("unsupported DA scheme: %s", u.Scheme)
Expand Down

0 comments on commit c640859

Please sign in to comment.