Skip to content
New issue

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

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

Already on GitHub? # to your account

Panic on startup with plugins.path containing subdirectories #12

Closed
insidieux opened this issue Mar 23, 2021 · 0 comments · Fixed by #13
Closed

Panic on startup with plugins.path containing subdirectories #12

insidieux opened this issue Mar 23, 2021 · 0 comments · Fixed by #13
Assignees
Labels
bug Something isn't working

Comments

@insidieux
Copy link
Owner

Describe the bug

Running inizio with --plugin.path, which contains subdirectories, cause panic with index out of range.

The problem is in incorrect usage of afero.Fs: RegexpFs does not skip directories according to passed regexp:
if i.IsDir() || f.re.MatchString(i.Name())

To Reproduce

Steps to reproduce the behavior:

  • create directory /usr/local/bin/inizio-plugins
  • create directory /usr/local/bin/inizio-plugins/test
  • run inizio: inizio /path/to/project

Expected behavior

inizio must skip FS items according to regexp and not exit with panic.

Environment:

  • Version: [e.g. v1.1.0]
  • GOOS: [darwin]

Additional context

Panic stack trace:

panic: runtime error: index out of range [1] with length 0

goroutine 1 [running]:
github.com/insidieux/inizio/internal/plugins.(*Loader).Load(0xc0001d9bd0, 0x17c6df0, 0xc00028c6c0, 0x7ffeefbffb36, 0x2d, 0xc000322a20, 0x16f74ff, 0xc, 0x7ffeefbffb36, 0x2d)
	/project/internal/plugins/loader.go:51 +0x685
@insidieux insidieux added the bug Something isn't working label Mar 23, 2021
@insidieux insidieux self-assigned this Mar 23, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant