tests: add basic cli tests

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
Andrea Luzzardi
2021-04-01 16:15:06 -07:00
parent 48e8b200ae
commit 429820036f
5 changed files with 101 additions and 2 deletions

View File

@@ -208,7 +208,10 @@ func (v *Value) Source(opts ...cue.Option) ([]byte, error) {
v.cc.rlock()
defer v.cc.runlock()
return cueformat.Node(v.val.Eval().Syntax(opts...))
return cueformat.Node(v.val.Eval().Syntax(opts...),
cueformat.UseSpaces(4),
cueformat.TabIndent(false),
)
}
func (v *Value) IsEmptyStruct() bool {

View File

@@ -46,7 +46,11 @@ func NewStore(root string) (*Store, error) {
}
func DefaultStore() (*Store, error) {
return NewStore(os.ExpandEnv(defaultStoreRoot))
root := defaultStoreRoot
if r := os.Getenv("DAGGER_STORE"); r != "" {
root = r
}
return NewStore(root)
}
func (s *Store) deploymentPath(name string) string {