boltops-tools / rspec-terraspace

Terraspace RSpec support
Apache License 2.0
2 stars 2 forks source link

detect_type fails when Dir.pwd doesn't contain trailing slash #9

Closed exoemay closed 1 year ago

exoemay commented 2 years ago

Hey, I've encountered an issue with an easy fix.

In project.rb, the detect_type function will fail if Dir.pwd does not contain a trailing slash (as is the case on my system). A simple ? after the slash in the regex fixes this issue.

md = dir.match(%r{app/(stacks|modules)/(.*)?/?})

If you want I can create a PR for this as well, unless you prefer a different solution.

tongueroo commented 2 years ago

The regexp works. Send the PR when you get the chance.

exoemay commented 2 years ago

PR is ready :)