b627b4bc88
This adds support for `--include` and `--exclude` for directory inputs. For instance, this is what you would want to use when passing dagger repository as an input: ``` inputs: repository: dir: path: . exclude: - '**/node_modules' - cmd/dagger/dagger - cmd/dagger/dagger-debug ``` Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
25 lines
530 B
Go
25 lines
530 B
Go
package environment
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
"go.dagger.io/dagger/state"
|
|
)
|
|
|
|
func TestLocalDirs(t *testing.T) {
|
|
st := &state.State{
|
|
Path: "/tmp/source",
|
|
Plan: "/tmp/source/plan",
|
|
}
|
|
require.NoError(t, st.SetInput("www.source", state.DirInput("/", []string{}, []string{})))
|
|
|
|
environment, err := New(st)
|
|
require.NoError(t, err)
|
|
|
|
localdirs := environment.LocalDirs()
|
|
require.Len(t, localdirs, 2)
|
|
require.Contains(t, localdirs, "/")
|
|
require.Contains(t, localdirs, "/tmp/source/plan")
|
|
}
|