Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix crash for excludedDirs #401

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix crash for excludedDirs
if run test for dir contains in excludedDirs comes crash goconvey!
i added tiny function, checkExcludedDirs, which checks it.

in my opinion, if the user specified directory for testing - it should be tested, regardless there is or not in the excludes...
sg3des committed Mar 4, 2016
commit d13013938bbc07194d48642599bf247f1b63e2bd
15 changes: 14 additions & 1 deletion goconvey.go
Original file line number Diff line number Diff line change
@@ -64,7 +64,7 @@ func main() {

watcherInput := make(chan messaging.WatcherCommand)
watcherOutput := make(chan messaging.Folders)
excludedDirItems := strings.Split(excludedDirs, `,`)
excludedDirItems := checkExcludedDirs(excludedDirs, working)
watcher := watch.NewWatcher(working, depth, nap, watcherInput, watcherOutput, watchedSuffixes, excludedDirItems)

parser := parser.NewParser(parser.ParsePackageResults)
@@ -80,6 +80,19 @@ func main() {
serveHTTP(server)
}

func checkExcludedDirs(s string, working string) []string {
var items []string
dirname := path.Base(working)

for _, item := range strings.Split(excludedDirs, `,`) {
if item != dirname {
items = append(items, item)
}
}

return items
}

func browserCmd() (string, bool) {
browser := map[string]string{
"darwin": "open",