diff --git a/go.mod b/go.mod index 933a3e1..0f79f5d 100644 --- a/go.mod +++ b/go.mod @@ -3,10 +3,10 @@ module github.com/bitrise-io/steps-fastlane go 1.12 require ( - github.com/bitrise-io/bitrise-init v0.0.0-20210518124036-0b2b7f91bdb1 - github.com/bitrise-io/go-android v0.0.0-20210517091621-72f0eb7a5197 - github.com/bitrise-io/go-steputils v0.0.0-20210514150206-5b6261447e77 - github.com/bitrise-io/go-utils v0.0.0-20210517140706-aa64fd88ca49 - github.com/bitrise-io/go-xcode v0.0.0-20210517092111-792daa927657 + github.com/bitrise-io/bitrise-init v0.0.0-20210520122036-d213de321eb8 + github.com/bitrise-io/go-android v0.0.0-20210527143215-3ad22ad02e2e + github.com/bitrise-io/go-steputils v0.0.0-20210527075147-910ce7a105a1 + github.com/bitrise-io/go-utils v0.0.0-20210520073355-367fa34178f5 + github.com/bitrise-io/go-xcode v0.0.0-20210521101355-fb6a1eb6e05b github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 ) diff --git a/go.sum b/go.sum index 8140624..b1a5fc0 100644 --- a/go.sum +++ b/go.sum @@ -1,38 +1,37 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/beevik/etree v1.1.0 h1:T0xke/WvNtMoCqgzPhkX2r4rjY3GDZFi+FjpRZY2Jbs= github.com/beevik/etree v1.1.0/go.mod h1:r8Aw8JqVegEf0w2fDnATrX9VpkMcyFeM0FhwO62wh+A= -github.com/bitrise-io/bitrise v0.0.0-20210513161711-09b1442cf3e0 h1:Ym7cBQs7pqKEEp5eD/snnXKQse6sQr4ouijrHjpaU2Q= -github.com/bitrise-io/bitrise v0.0.0-20210513161711-09b1442cf3e0/go.mod h1:Jqf2PLwOKL1bYdbQIhVkNd55YyYKJBXyY0EtlRg5uw4= -github.com/bitrise-io/bitrise-init v0.0.0-20210518124036-0b2b7f91bdb1 h1:ujVxB2VA3xd0LgUkNucFhDg0moxAojx3KVY45hzbCoE= -github.com/bitrise-io/bitrise-init v0.0.0-20210518124036-0b2b7f91bdb1/go.mod h1:2bxvLp7xgXC3HsacG2Z5nn6WOjk8kbNOmLWjinnhnKg= +github.com/bitrise-io/bitrise v0.0.0-20210519130014-380842fb41c1 h1:PERqeGZZkMrGYSSN/Stk+YkhErgdk37aVqc5UgnIEoo= +github.com/bitrise-io/bitrise v0.0.0-20210519130014-380842fb41c1/go.mod h1:Jqf2PLwOKL1bYdbQIhVkNd55YyYKJBXyY0EtlRg5uw4= +github.com/bitrise-io/bitrise-init v0.0.0-20210520122036-d213de321eb8 h1:1EvmLZfb7z6zRrq3RoRufEtRXbnB1v0rrxEuEb70jDE= +github.com/bitrise-io/bitrise-init v0.0.0-20210520122036-d213de321eb8/go.mod h1:I9KSWJm177/IOBMQHzn6BLgymVLQ0xlv/gMwDCYkWYU= github.com/bitrise-io/colorstring v0.0.0-20180614154802-a8cd70115192/go.mod h1:CIHVcxZUvsG99XUJV6JlR7okNsMMGY81jMvPC20W+O0= github.com/bitrise-io/envman v0.0.0-20200512105748-919e33f391ee/go.mod h1:m8pTp1o3Sw9uzDxb1WRm5IBRnMau2iOvPMSnRCAhQNI= github.com/bitrise-io/envman v0.0.0-20210517135508-b2b4fe89eac5 h1:3jVXjsejV+1EW9Sp7ef+sMinD0J3HFsPgh4Du6ctqZc= github.com/bitrise-io/envman v0.0.0-20210517135508-b2b4fe89eac5/go.mod h1:m8pTp1o3Sw9uzDxb1WRm5IBRnMau2iOvPMSnRCAhQNI= -github.com/bitrise-io/go-android v0.0.0-20210517091621-72f0eb7a5197 h1:rdMOrZ6f5T8evFF8o+lBj9p5dPiwm+t7yCwHBGD3qZI= -github.com/bitrise-io/go-android v0.0.0-20210517091621-72f0eb7a5197/go.mod h1:vcNcrAM6B5gDdgDZ9n51FTLT/kTHmiWatjCkJcstCNY= +github.com/bitrise-io/go-android v0.0.0-20210527143215-3ad22ad02e2e h1:lkJnz+yXbIqFGpDTdRBBshqxeX0UCndJmEOp0yy2GRQ= +github.com/bitrise-io/go-android v0.0.0-20210527143215-3ad22ad02e2e/go.mod h1:gGXmY8hJ1x44AC98TIvZZvxP7o+hs4VI6wgmO4JMfEg= github.com/bitrise-io/go-plist v0.0.0-20210301100253-4b1a112ccd10/go.mod h1:pARutiL3kEuRLV3JvswidvfCj+9Y3qMZtji2BDqLFsA= github.com/bitrise-io/go-steputils v0.0.0-20210507072936-92fde382fb33/go.mod h1:YCtb1VETn/rF9tCt9oInhd/cwbt1ETPm+dTlDIfyD+A= -github.com/bitrise-io/go-steputils v0.0.0-20210514150206-5b6261447e77 h1:+wd+ADdtJCRL9JEghE1RMbR4ywXBYNvIBelAW/UkWr8= github.com/bitrise-io/go-steputils v0.0.0-20210514150206-5b6261447e77/go.mod h1:H0iZjgsAR5NA6pnlD/zKB6AbxEsskq55pwJ9klVmP8w= -github.com/bitrise-io/go-utils v0.0.0-20201019131314-6cc2aa4d248a/go.mod h1:tTEsKvbz1LbzuN/KpVFHXnLtcAPdEgIdM41s0lL407s= +github.com/bitrise-io/go-steputils v0.0.0-20210527075147-910ce7a105a1 h1:gi29hTdxGXAGQvZckPZ9V8BAEfP3eK/tiZgTC5s6h1c= +github.com/bitrise-io/go-steputils v0.0.0-20210527075147-910ce7a105a1/go.mod h1:H0iZjgsAR5NA6pnlD/zKB6AbxEsskq55pwJ9klVmP8w= github.com/bitrise-io/go-utils v0.0.0-20210505091801-98b7dc39ee61/go.mod h1:nhdaDQFvaMny1CugVV6KjK92/q97ENo0RuKSW5I4fbA= github.com/bitrise-io/go-utils v0.0.0-20210505121718-07411d72e36e/go.mod h1:nhdaDQFvaMny1CugVV6KjK92/q97ENo0RuKSW5I4fbA= github.com/bitrise-io/go-utils v0.0.0-20210506064210-b22e2b7b3ad3/go.mod h1:nhdaDQFvaMny1CugVV6KjK92/q97ENo0RuKSW5I4fbA= github.com/bitrise-io/go-utils v0.0.0-20210507100250-37de47dfa6ce/go.mod h1:15EZZf02noI5nWFqXMZEoyb1CyqYRXTMz5Fyu4CWFzI= github.com/bitrise-io/go-utils v0.0.0-20210514083430-4d1fb0330dfe/go.mod h1:DRx7oFuAqk0dbKpAKCqWl0TgrowfJUb/MqYPRscxJOQ= -github.com/bitrise-io/go-utils v0.0.0-20210517140706-aa64fd88ca49 h1:du0kI1TU7cv/Hr8U3plyAlMtyOf2kUj4CA4ku5bz20Y= -github.com/bitrise-io/go-utils v0.0.0-20210517140706-aa64fd88ca49/go.mod h1:DRx7oFuAqk0dbKpAKCqWl0TgrowfJUb/MqYPRscxJOQ= -github.com/bitrise-io/go-xcode v0.0.0-20210517092111-792daa927657 h1:p2R7vSBv9QqXcAdQXfiUJxatY7zQ7NZnrrfRYqO56ts= -github.com/bitrise-io/go-xcode v0.0.0-20210517092111-792daa927657/go.mod h1:OexOTlMlXuf88bsFsaw5KxmIYrYDsHkTh01vbhGNpus= +github.com/bitrise-io/go-utils v0.0.0-20210520073355-367fa34178f5 h1:kclxBfygfNK6kWUB+9xcsfPLBen8Us9gubhitfL/Z6c= +github.com/bitrise-io/go-utils v0.0.0-20210520073355-367fa34178f5/go.mod h1:DRx7oFuAqk0dbKpAKCqWl0TgrowfJUb/MqYPRscxJOQ= +github.com/bitrise-io/go-xcode v0.0.0-20210520114025-bdbec53ee59f/go.mod h1:a5IANtAnyazHgNjI6/kwQw5vU/WJo1zQ4Lja9WRUNmA= +github.com/bitrise-io/go-xcode v0.0.0-20210521101355-fb6a1eb6e05b h1:JyTlzvdOBOxtYZ7aZVCog2dZUv8LgA8UftT+TpVWtZY= +github.com/bitrise-io/go-xcode v0.0.0-20210521101355-fb6a1eb6e05b/go.mod h1:6Nv5RAsAVS745xN5IihUExVmCA9n9f7s/DSVow4hXrI= github.com/bitrise-io/goinp v0.0.0-20210504152833-8559b0680ab1/go.mod h1:iRbd8zAXLeNy+0gic0eqNCxXvDGe8ZEY/uYX2CCeAoo= github.com/bitrise-io/gows v0.0.0-20210505125306-dd92ff463938/go.mod h1:3Cp9ceJ8wHl1Av6oEE2ff1iWaYLliQuD+oaNdyM0NWQ= github.com/bitrise-io/pkcs12 v0.0.0-20210430063833-0da06eb56630/go.mod h1:UiXKNs0essbC14a2TvGlnUKo9isP9m4guPrp8KJHJpU= github.com/bitrise-io/stepman v0.0.0-20210505110307-5c2296bcc558/go.mod h1:WLh58JYBgbD1Z/yyw1AkFz/90F6oBL0HS/luBpUW9dI= github.com/bitrise-io/stepman v0.0.0-20210517135458-203f7a48d37a h1:qsEFYqhVeo0mLrdl7nLTNbCz0AZ+8nOxQD+LPFw2Oq4= github.com/bitrise-io/stepman v0.0.0-20210517135458-203f7a48d37a/go.mod h1:WLh58JYBgbD1Z/yyw1AkFz/90F6oBL0HS/luBpUW9dI= -github.com/bitrise-io/xcode-project v0.0.0-20201203153351-7ad13a1dd021/go.mod h1:R2iDrjJlNQtVwIdXT+F9bcx/YTNJPdd0tXfFRJsxHaM= -github.com/bitrise-io/xcode-project v0.0.0-20210302080829-f3e0bfbcd5cb/go.mod h1:t9Gj5Pe/FBDTUrkFmw2lK6PbzESB6o27eE97ukZj8Rs= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -52,7 +51,6 @@ github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANyt github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= -github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= @@ -76,22 +74,16 @@ github.com/stretchr/objx v0.3.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoH github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/urfave/cli v1.22.5/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/whilp/git-urls v1.0.0/go.mod h1:J16SAmobsqc3Qcy98brfl5f5+e0clUvg1krgwk/qCfE= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210503195802-e9a32991a82e/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= -golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -107,10 +99,6 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200220224806-8a925fa4c0df/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/vendor/github.com/bitrise-io/go-android/cache/cache.go b/vendor/github.com/bitrise-io/go-android/cache/cache.go index 496f859..1a282a0 100644 --- a/vendor/github.com/bitrise-io/go-android/cache/cache.go +++ b/vendor/github.com/bitrise-io/go-android/cache/cache.go @@ -4,11 +4,14 @@ import ( "crypto/md5" "fmt" "io" + "io/ioutil" "os" + "os/exec" "path/filepath" "strings" "github.com/bitrise-io/go-steputils/cache" + "github.com/bitrise-io/go-utils/command" "github.com/bitrise-io/go-utils/fileutil" "github.com/bitrise-io/go-utils/log" "github.com/bitrise-io/go-utils/pathutil" @@ -90,9 +93,15 @@ func collectIncludePaths(homeDir, projectDir string, cacheLevel cache.Level) ([] return nil } - md5Hash, err := computeMD5String(path) + unmodified, err := prepareUnmodifiedIndicator(path) if err != nil { - log.Warnf("Failed to compute MD5 hash of %s: %s", path, err) + log.Debugf(err.Error()) + unmodified = path + } + + md5Hash, err := computeMD5String(unmodified) + if err != nil { + log.Warnf("Failed to compute MD5 hash of %s -> %s: %s", path, unmodified, err) return nil } @@ -136,6 +145,49 @@ func collectIncludePaths(homeDir, projectDir string, cacheLevel cache.Level) ([] return includePths, nil } +/* +If the indicator is version controlled in git and has changes, we create a copy of it with its original content. +*/ +func prepareUnmodifiedIndicator(indicator string) (unmodified string, err error) { + indicatorDir := filepath.Dir(indicator) + indicatorFile := filepath.Base(indicator) + + cmd := exec.Command("git", "ls-files", "--error-unmatch", indicatorFile) + cmd.Dir = indicatorDir + m := command.NewWithCmd(cmd) + code, err := m.RunAndReturnExitCode() + if code != 0 { + return "", fmt.Errorf("%s is not under git version control", indicator) + } + cmd = exec.Command("git", "diff", "-s", "--exit-code", indicatorFile) + cmd.Dir = indicatorDir + m = command.NewWithCmd(cmd) + code, err = m.RunAndReturnExitCode() + if code == 0 { + return "", fmt.Errorf("%s has not modification compared to HEAD", indicator) + } + + file, err := ioutil.TempFile(os.TempDir(), "indicator") + if err != nil { + return "", err + } + defer func() { + e := file.Close() + if err == nil { + err = e + } + }() + + cmd = exec.Command("git", "show", "HEAD:"+indicatorFile) + cmd.Dir = indicatorDir + m = command.NewWithCmd(cmd).SetStdout(file).SetStderr(os.Stderr) + code, err = m.RunAndReturnExitCode() + if err != nil || code != 0 { + return "", err + } + return file.Name(), nil +} + func computeMD5String(filePath string) (string, error) { f, err := os.Open(filePath) if err != nil { diff --git a/vendor/github.com/bitrise-io/go-steputils/stepconf/stepconf.go b/vendor/github.com/bitrise-io/go-steputils/stepconf/stepconf.go index 9f7654a..da06ab3 100644 --- a/vendor/github.com/bitrise-io/go-steputils/stepconf/stepconf.go +++ b/vendor/github.com/bitrise-io/go-steputils/stepconf/stepconf.go @@ -102,9 +102,43 @@ func parseTag(tag string) (string, string) { return tag, "" } -// Parse populates a struct with the retrieved values from environment variables -// described by struct tags and applies the defined validations. -func Parse(conf interface{}) error { +// EnvProvider ... +type EnvProvider interface { + Getenv(key string) string +} + +// OSEnvProvider ... +type OSEnvProvider struct{} + +// NewOSEnvProvider ... +func NewOSEnvProvider() EnvProvider { + return OSEnvProvider{} +} + +// Getenv ... +func (p OSEnvProvider) Getenv(key string) string { + return os.Getenv(key) +} + +// EnvParser ... +type EnvParser struct { + envProvider EnvProvider +} + +// NewDefaultEnvParser ... +func NewDefaultEnvParser() EnvParser { + return NewEnvParser(NewOSEnvProvider()) +} + +// NewEnvParser ... +func NewEnvParser(envProvider EnvProvider) EnvParser { + return EnvParser{ + envProvider: envProvider, + } +} + +// Parse ... +func (p EnvParser) Parse(conf interface{}) error { c := reflect.ValueOf(conf) if c.Kind() != reflect.Ptr { return ErrNotStructPtr @@ -122,7 +156,7 @@ func Parse(conf interface{}) error { continue } key, constraint := parseTag(tag) - value := os.Getenv(key) + value := p.envProvider.Getenv(key) if err := setField(c.Field(i), value, constraint); err != nil { errs = append(errs, &ParseError{t.Field(i).Name, value, err}) @@ -141,6 +175,22 @@ func Parse(conf interface{}) error { return nil } +var defaultEnvParser *EnvParser + +func getDefaultEnvParser() EnvParser { + if defaultEnvParser == nil { + parser := NewDefaultEnvParser() + defaultEnvParser = &parser + } + return *defaultEnvParser +} + +// Parse populates a struct with the retrieved values from environment variables +// described by struct tags and applies the defined validations. +func Parse(conf interface{}) error { + return getDefaultEnvParser().Parse(conf) +} + func setField(field reflect.Value, value, constraint string) error { if err := validateConstraint(value, constraint); err != nil { return err diff --git a/vendor/github.com/bitrise-io/go-utils/pathutil/glob.go b/vendor/github.com/bitrise-io/go-utils/pathutil/glob.go new file mode 100644 index 0000000..232dd51 --- /dev/null +++ b/vendor/github.com/bitrise-io/go-utils/pathutil/glob.go @@ -0,0 +1,13 @@ +package pathutil + +// EscapeGlobPath escapes a partial path, determined at runtime, used as a parameter for filepath.Glob +func EscapeGlobPath(path string) string { + var escaped string + for _, ch := range path { + if ch == '[' || ch == ']' || ch == '-' || ch == '*' || ch == '?' || ch == '\\' { + escaped += "\\" + } + escaped += string(ch) + } + return escaped +} diff --git a/vendor/github.com/bitrise-io/go-utils/pathutil/pathutil.go b/vendor/github.com/bitrise-io/go-utils/pathutil/pathutil.go index 957f4f7..db577e3 100644 --- a/vendor/github.com/bitrise-io/go-utils/pathutil/pathutil.go +++ b/vendor/github.com/bitrise-io/go-utils/pathutil/pathutil.go @@ -215,3 +215,24 @@ func ListPathInDirSortedByComponents(searchDir string, relPath bool) ([]string, } return SortPathsByComponents(fileList) } + +// ListEntries filters contents of a directory using the provided filters +func ListEntries(dir string, filters ...FilterFunc) ([]string, error) { + absDir, err := filepath.Abs(dir) + if err != nil { + return []string{}, err + } + + entries, err := ioutil.ReadDir(absDir) + if err != nil { + return []string{}, err + } + + var paths []string + for _, entry := range entries { + pth := filepath.Join(absDir, entry.Name()) + paths = append(paths, pth) + } + + return FilterPaths(paths, filters...) +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 1ae2789..6681f96 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1,8 +1,8 @@ # github.com/beevik/etree v1.1.0 github.com/beevik/etree -# github.com/bitrise-io/bitrise v0.0.0-20210513161711-09b1442cf3e0 +# github.com/bitrise-io/bitrise v0.0.0-20210519130014-380842fb41c1 github.com/bitrise-io/bitrise/models -# github.com/bitrise-io/bitrise-init v0.0.0-20210518124036-0b2b7f91bdb1 +# github.com/bitrise-io/bitrise-init v0.0.0-20210520122036-d213de321eb8 github.com/bitrise-io/bitrise-init/analytics github.com/bitrise-io/bitrise-init/models github.com/bitrise-io/bitrise-init/scanners/android @@ -10,9 +10,9 @@ github.com/bitrise-io/bitrise-init/steps github.com/bitrise-io/bitrise-init/utility # github.com/bitrise-io/envman v0.0.0-20210517135508-b2b4fe89eac5 github.com/bitrise-io/envman/models -# github.com/bitrise-io/go-android v0.0.0-20210517091621-72f0eb7a5197 +# github.com/bitrise-io/go-android v0.0.0-20210527143215-3ad22ad02e2e github.com/bitrise-io/go-android/cache -# github.com/bitrise-io/go-steputils v0.0.0-20210514150206-5b6261447e77 +# github.com/bitrise-io/go-steputils v0.0.0-20210527075147-910ce7a105a1 github.com/bitrise-io/go-steputils/cache github.com/bitrise-io/go-steputils/command/gems github.com/bitrise-io/go-steputils/command/rubycommand @@ -20,7 +20,7 @@ github.com/bitrise-io/go-steputils/input github.com/bitrise-io/go-steputils/step github.com/bitrise-io/go-steputils/stepconf github.com/bitrise-io/go-steputils/tools -# github.com/bitrise-io/go-utils v0.0.0-20210517140706-aa64fd88ca49 +# github.com/bitrise-io/go-utils v0.0.0-20210520073355-367fa34178f5 github.com/bitrise-io/go-utils/colorstring github.com/bitrise-io/go-utils/command github.com/bitrise-io/go-utils/errorutil @@ -31,7 +31,7 @@ github.com/bitrise-io/go-utils/parseutil github.com/bitrise-io/go-utils/pathutil github.com/bitrise-io/go-utils/pointers github.com/bitrise-io/go-utils/sliceutil -# github.com/bitrise-io/go-xcode v0.0.0-20210517092111-792daa927657 +# github.com/bitrise-io/go-xcode v0.0.0-20210521101355-fb6a1eb6e05b github.com/bitrise-io/go-xcode/appleauth github.com/bitrise-io/go-xcode/devportalservice # github.com/bitrise-io/stepman v0.0.0-20210517135458-203f7a48d37a