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

Improve inject() in bundler #743

Merged
merged 1 commit into from
Jun 2, 2024
Merged

Conversation

asherber
Copy link
Member

@asherber asherber commented Jun 2, 2024

@rpatters1 Not sure if you wanted to review this.

The inject() function in the bunder, which inserts HashURL and RTFNotes, was assuming that there would only be one line in plugindef() that starts with return and one line that starts with end. This is not necessarily true, since a line of text in Notes, for example, could start with either of these. (And the Notes in the script I recently added did!)

This PR changes inject() to get the last matching token. There's still an edge case here if plugindef() does not include a return statement (since it's not technically required) but does have a line starting with return in Notes. But since this repo seems to have an unofficial requirement for a proper plugindef() function with a return, I'm not worried about this.

@asherber
Copy link
Member Author

asherber commented Jun 2, 2024

BTW, I ran the bundler locally, and there were no changes to the generated dist files, as expected.

@rpatters1
Copy link
Collaborator

I'm cool with it if it works.

@asherber asherber merged commit 03d7416 into finale-lua:master Jun 2, 2024
2 checks passed
@asherber asherber deleted the end-regex branch June 2, 2024 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants