From 4ab499deb3955c6bfcce48d2f3eb36ef23836d71 Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Mon, 27 Jul 2020 08:20:15 +0100 Subject: now we find xlsm files as well seemingly --- pkg/datamaps/reader.go | 2 +- pkg/datamaps/reader_test.go | 7 +++++-- pkg/datamaps/testdata/test_template.xlsm | Bin 0 -> 9193 bytes 3 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 pkg/datamaps/testdata/test_template.xlsm (limited to 'pkg/datamaps') diff --git a/pkg/datamaps/reader.go b/pkg/datamaps/reader.go index 3f1e26d..d706d8f 100644 --- a/pkg/datamaps/reader.go +++ b/pkg/datamaps/reader.go @@ -250,7 +250,7 @@ func getTargetFiles(path string) ([]string, error) { return nil, fmt.Errorf("path must end in a %s character", string(filepath.Separator)) } - fullpath := strings.Join([]string{path, "*.xlsx"}, "") + fullpath := strings.Join([]string{path, "*.xls[xm]"}, "") output, err := filepath.Glob(fullpath) if err != nil { diff --git a/pkg/datamaps/reader_test.go b/pkg/datamaps/reader_test.go index abe5afc..32e7f67 100644 --- a/pkg/datamaps/reader_test.go +++ b/pkg/datamaps/reader_test.go @@ -231,9 +231,12 @@ func TestGetTargetFiles(t *testing.T) { }{ {"Get files in testdata", args{"./testdata/"}, - []string{"testdata/test_template.xlsx", + []string{ + "testdata/test_template.xlsm", + "testdata/test_template.xlsx", "testdata/test_template2.xlsx", - "testdata/test_template3.xlsx"}, + "testdata/test_template3.xlsx", + }, false, }, } diff --git a/pkg/datamaps/testdata/test_template.xlsm b/pkg/datamaps/testdata/test_template.xlsm new file mode 100644 index 0000000..77ac56f Binary files /dev/null and b/pkg/datamaps/testdata/test_template.xlsm differ -- cgit v1.2.3