代码拉取完成,页面将自动刷新
# Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
$version = "0.94.00"
$vsRelease = "2019"
function replaceVersionInfo($version)
{
$versionInfoRegex = new-object Text.RegularExpressions.Regex "// NPP plugin platform for .Net v(\d+\.\d+(\.\d+)?) by Kasper B. Graversen etc.", "None"
$files = get-ChildItem -Path . -Recurse -ErrorAction SilentlyContinue -Filter *.cs
ForEach ($f in $files)
{
$name = $f.Fullname
$content = [IO.File]::ReadAllText($name)
$original = $content
$content = $versionInfoRegex.Replace($content, "// NPP plugin platform for .Net v"+ $version + " by Kasper B. Graversen etc.")
If ($content -ne $original)
{
[IO.File]::WriteAllText("$name", $content, [Text.Encoding]::"UTF8")
}
}
}
cd 'Visual Studio Project Template C#'
replaceVersionInfo($version)
$filename = "NppPlugin" + $version + ".zip"
write-host "# zip the projectTemplate '$filename'" -foreground green
& 'C:\Program Files\7-Zip\7z.exe' a -tzip $filename * -xr!bin -xr!obj
$vsTemplatepath = [Environment]::GetFolderPath("MyDocuments") + "\Visual Studio " +
$vsRelease + '\Templates\ProjectTemplates\Visual C#\'
write-host "# Copy projectTemplate to VS: '$vsTemplatepath'" -foreground green
if (Test-Path $vsTemplatepath) {
del "$($vsTemplatepath)\nppplugin*.zip"
} else {
ni -ItemType Directory -Force -Path $vsTemplatepath
}
copy $filename $($vsTemplatepath)
write-host "# remove temp files" -foreground green
rm $filename
cd ..
# Read-Host -Prompt "Press Enter to continue"
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。