When an argument is provided on README or AutoRest commandline and the argument points to a relative path, the user is assuming the path is relative to the README file or where the user is running the AutoRest CLI.
getStringValue("output-folder") ===> "..\"
getValue(List.class, "input-file") ===> ["../../../autorest.testserver/swagger/body-complex.json"]
getStringValue("customization-jar-path") ===> "target/bodycomplex-customization-1.0.0-beta.1.jar"
We need a way for AutoRest plugins to get the absolute paths for these arguments.
Solution 1: Repurpose the base-folder configuration, or add a new configuration
Currently, there's a configuration base-folder that always has value ".". We may be able to repurpose this to contain the folder where README.md file is located, or where AutoRest is launched from. Then the plugins will be able to assemble the absolute paths themselves.
**Caveat"": If the user provides some paths on the README and some on the command, then there's no way to tell which base folder is intended by the user for each path argument.
Solution 2: Resolve all the relative paths to absolute paths
We can introduce the absolute version of each path argument, input-file-absolute, output-folder-absolute, and customization-jar-path-absolute, etc. That way the plugins can pick these up directly, and not have to resolve the relative paths.
Caveat: For plugins that do not need the absolute paths for these, there may be a performance hit to resolve all the path arguments.
When an argument is provided on README or AutoRest commandline and the argument points to a relative path, the user is assuming the path is relative to the README file or where the user is running the AutoRest CLI.
We need a way for AutoRest plugins to get the absolute paths for these arguments.
Solution 1: Repurpose the
base-folderconfiguration, or add a new configurationCurrently, there's a configuration
base-folderthat always has value ".". We may be able to repurpose this to contain the folder where README.md file is located, or where AutoRest is launched from. Then the plugins will be able to assemble the absolute paths themselves.**Caveat"": If the user provides some paths on the README and some on the command, then there's no way to tell which base folder is intended by the user for each path argument.
Solution 2: Resolve all the relative paths to absolute paths
We can introduce the absolute version of each path argument,
input-file-absolute,output-folder-absolute, andcustomization-jar-path-absolute, etc. That way the plugins can pick these up directly, and not have to resolve the relative paths.Caveat: For plugins that do not need the absolute paths for these, there may be a performance hit to resolve all the path arguments.