Skip to content

Commit

Permalink
cmd/init: print workspace path
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Alba <sam.alba@gmail.com>
  • Loading branch information
samalba committed May 26, 2021
1 parent 9d16091 commit 1f4bbc5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmd/dagger/cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,12 @@ var initCmd = &cobra.Command{
dir = cwd
}

_, err := state.Init(ctx, dir)
ws, err := state.Init(ctx, dir)
if err != nil {
lg.Fatal().Err(err).Msg("failed to initialize workspace")
}

lg.Info().Str("path", ws.DaggerDir()).Msg("initialized new empty workspace")
},
}

Expand Down
4 changes: 4 additions & 0 deletions state/workspace.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,3 +268,7 @@ func (w *Workspace) Create(ctx context.Context, name string) (*State, error) {

return st, nil
}

func (w *Workspace) DaggerDir() string {
return path.Join(w.Path, daggerDir)
}

0 comments on commit 1f4bbc5

Please sign in to comment.