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

FAKE.Deploy WorkDirectory fix #461 #520

Merged
merged 1 commit into from
Aug 25, 2014
Merged

Conversation

sergey-tihon
Copy link
Member

No description provided.

| true, _ ->
let exeLocation = typedefof<FakeDeployService>.Assembly.Location
let directory = IO.Path.GetDirectoryName(exeLocation)
directory @@ path
Copy link
Member

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?

Copy link
Member Author

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 your CurrentDirectory will be C:\Windows\system32. So if you have relative path in WorkDirectory variable, IO.Path.GetFullPath returns path relative from C:\Windows\system32 what is not intuitive.

I am sure that Fake.Deploy should operates identically in both modes (console & windows service).

Copy link
Member

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.

Copy link
Member Author

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?

Path.GetFullPath method uses current directory and current volume information to fully qualify path. 

So, the result is depend on current directory which is different for our cases.
Or you suggest to temporary change Environment.CurrentDirectory property to exeLocation?

Copy link
Member

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.

forki added a commit that referenced this pull request Aug 25, 2014
@forki forki merged commit 62ac6e9 into fsprojects:master Aug 25, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants