Skip to content

Commit

Permalink
Merge pull request #520 from sergey-tihon/workDir
Browse files Browse the repository at this point in the history
FAKE.Deploy WorkDirectory fix #461
  • Loading branch information
forki committed Aug 25, 2014
2 parents f5b0532 + 2fcc177 commit 62ac6e9
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/app/Fake.Deploy/Services.fs
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,20 @@ type FakeDeployService() as self =
if success then port' else 8080

DeploymentAgent.workDir <-
if args <> null && args.Length > 3 then args.[3]
else ConfigurationManager.AppSettings.["WorkDirectory"]
let path =
if args <> null && args.Length > 3 then args.[3]
else ConfigurationManager.AppSettings.["WorkDirectory"]
match Uri.TryCreate(path, UriKind.RelativeOrAbsolute) with
| false, _ -> failwithf "Incorrect path '%s'" path
| true, uri when uri.IsAbsoluteUri -> path
| true, _ ->
let exeLocation = typedefof<FakeDeployService>.Assembly.Location
let directory = IO.Path.GetDirectoryName(exeLocation)
directory @@ path

let uri = sprintf "http://%s:%i/" serverName port
logger(sprintf "Listening on %s" uri, EventLogEntryType.Information)
logger(sprintf "WorkDirectory is %s" DeploymentAgent.workDir, EventLogEntryType.Information)
nancyHost <- DeploymentAgent.createNancyHost ([| Uri uri |])
nancyHost.Start()

Expand Down

0 comments on commit 62ac6e9

Please sign in to comment.