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

Extend "script" command to accept classpath references #1014

Open
tkrah opened this issue Mar 6, 2024 · 2 comments
Open

Extend "script" command to accept classpath references #1014

tkrah opened this issue Mar 6, 2024 · 2 comments
Labels
type/enhancement Is an enhancement request type/help-needed Calling help

Comments

@tkrah
Copy link

tkrah commented Mar 6, 2024

The script command does accept files only at the moment.

If the command would use something like this:

public void script(String ref) throws Exception {
        Resource res = getApplicationContext().getResource(ref);
        Reader reader = new StringReader(new String(res.getInputStream().readAllBytes(), StandardCharsets.UTF_8));
        try (FileInputProvider inputProvider = new FileInputProvider(reader, parser)) {
            getShell().run(inputProvider);
        }
}

the script could be something like: "classpath:scripts/runthis" or "file:...." - all things possible which the app context can resolve.
To be backwards compatible you could prefix "ref" always with "file:.." if nothing else is specified on the argument.

@github-actions github-actions bot added the status/need-triage Team needs to triage and take a first look label Mar 6, 2024
@jvalkeal jvalkeal added type/enhancement Is an enhancement request and removed status/need-triage Team needs to triage and take a first look labels Mar 10, 2024
@jvalkeal
Copy link
Contributor

Thanks for a proposal and I think it's definitely something what shell could support. We're probably not going to work in this feature but if you think it's important to you then we'd welcome a PR!

@jvalkeal jvalkeal added the type/help-needed Calling help label Mar 10, 2024
@jvalkeal
Copy link
Contributor

Just a note for script runner behaviour in current main (aka 3.3.x) #1017 disabled this runner on default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement Is an enhancement request type/help-needed Calling help
Projects
None yet
Development

No branches or pull requests

2 participants