Skip to content

Commit

Permalink
added script to gather vsix files
Browse files Browse the repository at this point in the history
  • Loading branch information
Irame committed Apr 2, 2024
1 parent d8b5964 commit a618b2a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Comment the next line if you want to checkin your web deploy settings
# TODO: Comment the next line if you want to checkin your web deploy settings
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
Expand Down Expand Up @@ -202,3 +202,6 @@ FakesAssemblies/

# Ignore .args.json files for TestProjects
/TestProjects/**/*.args.json

# ignore gatherd vsix files for release
*.vsix
23 changes: 23 additions & 0 deletions GatherVsixFiles.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
$tag = git describe --tags

if ($LastExitCode -eq 0 -and -not [string]::IsNullOrWhiteSpace($tag)) {
$filesMap = @{
"SmartCmdArgs\SmartCmdArgs15\bin\Release\SmartCmdArgs15.vsix" = "SmartCmdArgs-vs2017-{0}.vsix";
"SmartCmdArgs\SmartCmdArgs16\bin\Release\SmartCmdArgs16.vsix" = "SmartCmdArgs-vs2019-{0}.vsix";
"SmartCmdArgs\SmartCmdArgs17\bin\Release\SmartCmdArgs17.vsix" = "SmartCmdArgs-vs2022-{0}.vsix";
}

foreach ($file in $filesMap.Keys) {
$newFileName = $filesMap[$file] -f $tag
$destinationPath = ".\$newFileName"
Copy-Item $file -Destination $destinationPath

if ($LastExitCode -eq 0) {
Write-Host "Copied and renamed $file to $newFileName successfully."
} else {
Write-Host "Failed to copy $file."
}
}
} else {
Write-Host "Failed to get the latest git tag."
}

0 comments on commit a618b2a

Please sign in to comment.