-
Notifications
You must be signed in to change notification settings - Fork 739
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
Resolve relative paths provided in README or commandline #3695
Comments
SummaryToday, all the relative paths inside a Readme are solved relatively to that Readme place. For instance This applies to Problem for people like @pakrym , if "output-folder" is the project folder, then he cannot use Solutions I have in mind: Solution 1:
Example of conf:
Problem is that we need now to prefix all "WriteFile" call with "src". So not sure I like it. Solution 2:Add Example of conf:
This last one is more a convention and don't deserve extra code from David. I believe autorest already support recursive variable injection like that. This is the less disruptive, and we can tight the customizations to the presence of a Thoughts? |
Thanks @lmazuel I definitely prefer the second one, it keeps the basics similar, but allows users greater customizability (idk if that's a word) |
@lmazuel I really like the second option and it would work well with c#. Thanks for suggestion. |
@timotheeguerin please write some doc and close it |
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-folder
configuration, or add a new configurationCurrently, 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
, 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.
The text was updated successfully, but these errors were encountered: