Skip to content

Commit

Permalink
dont create relative path
Browse files Browse the repository at this point in the history
  • Loading branch information
theimowski committed Sep 30, 2014
1 parent 818f791 commit 5556ed2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/Paket/SolutionFile.fs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type SolutionFile(fileName: string) =

let removeNugetSlnFolderIfEmpty() =
match content |> Seq.tryFindIndex (fun line ->
line.StartsWith(sprintf """Project({%s})""" slnFolderProjectGuid) && line.Contains(".nuget")) with
line.StartsWith(sprintf "Project(\"{%s}\")" slnFolderProjectGuid) && line.Contains(".nuget")) with
| Some(index) ->
if content.[index+1].Contains("ProjectSection(SolutionItems)") &&
content.[index+2].Contains("EndProjectSection") &&
Expand All @@ -33,13 +33,11 @@ type SolutionFile(fileName: string) =
member __.AddPaketFolder(dependenciesFile, lockFile) =
match content |> Seq.tryFindIndex (fun line -> line.StartsWith("MinimumVisualStudioVersion")) with
| Some index ->
let depFile = createRelativePath dependenciesFile fileName
let lockFile = lockFile |> Option.map (fun l -> createRelativePath l fileName)
let lines = ResizeArray<_>()

lines.Add(sprintf "Project(\"{%s}\") = \".paket\", \".paket\", \"{%s}\"" slnFolderProjectGuid <| Guid.NewGuid().ToString("D"))
lines.Add(sprintf "Project(\"{%s}\") = \".paket\", \".paket\", \"{%s}\"" slnFolderProjectGuid <| Guid.NewGuid().ToString("D").ToUpper())
lines.Add " ProjectSection(SolutionItems) = preProject"
lines.Add(sprintf " %s = %s" depFile depFile)
lines.Add(sprintf " %s = %s" dependenciesFile dependenciesFile)
if lockFile |> Option.isSome then
lines.Add(sprintf" %s = %s" lockFile.Value lockFile.Value)
lines.Add " EndProjectSection"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.30501.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{A46447A8-8FAF-442D-ADCC-DEB2EBB2067A}"
ProjectSection(SolutionItems) = preProject
.nuget\packages.config = .nuget\packages.config
EndProjectSection
EndProject
Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down

0 comments on commit 5556ed2

Please sign in to comment.