What does the </ "> operator do in FAKE build scripts?
I just found this target in the FAKE script generated by ProjectScaffold:
// Copies binaries from default VS location to expected bin folder
// But keeps a subdirectory structure for each project in the
// src folder to support multiple project outputs
Target "CopyBinaries" (fun _ ->
!! "src/**/*.??proj"
-- "src/**/*.shproj"
|> Seq.map (fun f -> ((System.IO.Path.GetDirectoryName f)
</> "bin/Release", "bin"
</> (System.IO.Path.GetFileNameWithoutExtension f)))
|> Seq.iter (fun (fromDir, toDir) -> CopyDir toDir fromDir (fun _ -> true))
)
My question is: what does this weird operator </>do?
(My internet search was not very successful.)
The operator </>is an infix operator and combines two path segments into one full path. In this aspect, it is almost the same as the @@ operator. The statement </>was created after the @@ operator because the @@ operator behaves strangely on UNIX-like systems when the second path starts with root.
Here is an example taken from the problem description on GitHub.
"src" @@ "/home/projects/something" returns "src/home/projects/something"
"src" </> "/home/projects/something" returns "/home/projects/something"
EnvironmentHelper: https://fsharp.imtqy.com/FAKE/apidocs/fake-environmenthelper.html
: https://github.com/fsharp/FAKE/issues/670, https://github.com/fsharp/FAKE/pull/695