Skip to content

Commit baac430

Browse files
author
Kapil Borle
committed
Fix project root path in resource generation file
1 parent 11b08d6 commit baac430

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

New-StronglyTypedCsFileForResx.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ internal class {0} {{
113113
$entry -f $name,$val
114114
}
115115
} | Out-String
116-
116+
117117
$bodyCode = $body -f $shortClassName,$ModuleName,$entries,$ClassName
118118

119119
if ($NamespaceName)
@@ -126,10 +126,10 @@ internal class {0} {{
126126
return $resultCode -replace "`r`n?|`n","`r`n"
127127
}
128128

129-
$projectRoot = Split-Path $MyInvocation.InvocationName
129+
$projectRoot = $PWD
130130
if (-not (Test-Path "$projectRoot/global.json"))
131131
{
132-
throw "Not in solution root"
132+
throw "Not in solution root: $projectRoot"
133133
}
134134
$inputFilePath = Join-Path $projectRoot "$project/Strings.resx"
135135
$outputFilePath = Join-Path $projectRoot "$project/Strings.cs"
@@ -141,4 +141,4 @@ if ($project -eq "Rules")
141141
$className += ".Strings"
142142
$xml = [xml](Get-Content -raw $inputFilePath)
143143
$genSource = Get-StronglyTypeCsFileForResx -xml $xml -ModuleName Foo -ClassName $className
144-
Set-Content -Encoding Ascii -Path $outputFilePath -Value $genSource
144+
Set-Content -Encoding Ascii -Path $outputFilePath -Value $genSource

0 commit comments

Comments
 (0)