update PSVersionTable code to use powershell.version rather than .version because on Linux the .version file doesn't seem to be binplaced. I postulate this is because it's a hidden file

This commit is contained in:
James Truher
2016-05-19 13:19:16 -07:00
parent 99402343fc
commit 8583cf5e96
6 changed files with 12 additions and 5 deletions
+3
View File
@@ -15,3 +15,6 @@ install.ps1
# We copy powershell.exe as a content in host dotnet cli projects
*.exe
# ignore the version file as it is generated at build time
powershell.version
+1 -1
View File
@@ -53,7 +53,7 @@ function Start-PSBuild {
[string]$msbuildConfiguration = "Release"
)
git describe --dirty --abbrev=60 > "$psscriptroot/.version"
git describe --dirty --abbrev=60 > "$psscriptroot/powershell.version"
# simplify ParameterSetNames
if ($PSCmdlet.ParameterSetName -eq 'FullCLR') {
@@ -19,7 +19,7 @@
"Modules",
"../Modules",
"powershell.exe",
"../../.version"
"../../powershell.version"
],
"frameworks": {
@@ -82,12 +82,12 @@ namespace System.Management.Automation
return new Version(buildVersion);
}
// Get the commit id from the .version file. If the .version file doesn't exist, use the string "N/A"
// Get the commit id from the powershell.version file. If the powershell.version file doesn't exist, use the string "N/A"
static internal string GetCommitInfo()
{
try {
string assemblyPath = IO.Path.GetDirectoryName(typeof(PSVersionInfo).GetTypeInfo().Assembly.Location);
return (IO.File.ReadAllLines(IO.Path.Combine(assemblyPath,".version"))[0]);
return (IO.File.ReadAllLines(IO.Path.Combine(assemblyPath,"powershell.version"))[0]);
}
catch (Exception e){
return e.Message;
+2 -1
View File
@@ -19,7 +19,8 @@
"../Modules",
"*_profile.ps1",
"*.so",
"*.dylib"
"*.dylib",
"../../powershell.version"
],
"frameworks": {
+3
View File
@@ -15,6 +15,9 @@ Describe "PSVersionTable" {
$PSVersionTable.ContainsKey("GitCommitId") | Should Be True
}
It "GitCommitId property should not contain an error" {
$PSVersionTable.GitCommitId | Should not match "powershell.version"
}
It "Should have the correct edition" -Skip:(!$IsCore) {
$expected =