Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not simply use
IO.Path.GetFullPath
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When you install
Fake.Deploy
as Windows service yourCurrentDirectory
will beC:\Windows\system32
. So if you have relative path inWorkDirectory
variable,IO.Path.GetFullPath
returns path relative fromC:\Windows\system32
what is not intuitive.I am sure that
Fake.Deploy
should operates identically in both modes (console & windows service).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get your point.
Also with
GetFullPath
Fake.Deploy
would operate identically in both modes, as it doesn't change the program logic depending on the mode.But for ease of use I would also go with the suggested functionality. It should only be well documented.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, but I do not understand... Could you explain?
So, the result is depend on current directory which is different for our cases.
Or you suggest to temporary change
Environment.CurrentDirectory
property toexeLocation
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I mean the application operates also consistently with
GetFullPath
as in either mode, console or windows service, it depends on current directory.With your suggestion it depends on executable directory. Also consistently in both modes.