Skip to content

Commit

Permalink
Merge pull request #581 from sharwell/solution-dir
Browse files Browse the repository at this point in the history
Use solution directory from replacements
  • Loading branch information
sharwell authored Aug 7, 2020
2 parents 8306456 + 77e0ab3 commit dec70c5
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,15 @@ private void OnRunStarted(DTE dte, Dictionary<string, string> replacementsDictio
GlobalDictionary["$saferootprojectname$"] = replacementsDictionary["$safeprojectname$"];
GlobalDictionary["$saferootidentifiername$"] = replacementsDictionary["$safeprojectname$"].Replace(".","");

var solutionFile = dte.Solution.FullName;
var solutionFolder = Path.GetDirectoryName(solutionFile);
if (!replacementsDictionary.TryGetValue("$solutiondirectory$", out var solutionFolder))
{
var solutionFile = dte.Solution.FullName;
if (string.IsNullOrEmpty(solutionFile))
return;

solutionFolder = Path.GetDirectoryName(solutionFile);
}

if (Directory.Exists(solutionFolder))
{
File.WriteAllText(
Expand Down

0 comments on commit dec70c5

Please sign in to comment.