Conversation
Resolve the --file value with DefaultResourceLoader so classpath: and file: references work. An existing filesystem path keeps the previous behavior. Fixes spring-projects#1014 Signed-off-by: ezequiel primon <ezeprimo.ia@gmail.com>
| /** | ||
| * Tests for {@link Script}. | ||
| * | ||
| * @author David Pilar |
There was a problem hiding this comment.
You should use your own name as an author, not mine... ;-)
Signed-off-by: ezequiel primon <ezeprimo.ia@gmail.com>
|
Author adjusted. |
|
Thank you for the contribution! LGTM, I will merge it. However, I will add a follow-up commit to restrict resource resolution to |
- Restrict resources to file: and classpath: - Update Javadocs - Update documentation Issue #1014
Fixes #1014
script --fileonly accepted absolute filesystem paths. It now resolves the value withDefaultResourceLoader, soclasspath:...andfile:...references work. An existing filesystem path keeps the previous behavior (backward compatible, no new options).Summary:
Scriptresolves--file/-fas a Spring resource, file-first fallbackFileInputProvidergained aReaderoverload reusing the line-continuation/comment logicspring-shell-core/.../command/Script.javaspring-shell-core/.../FileInputProvider.javaReaderconstructorspring-shell-core/.../command/ScriptTests.javaspring-shell-core/.../FileInputProviderTests.javaTest plan:
mvn -pl spring-shell-core -am -Dtest=ScriptTests,FileInputProviderTests test: 6/6 green (JDK 17)mvn -pl spring-shell-core -am test: 222/222 green