代码拉取完成,页面将自动刷新
同步操作将从 林中白狼/基于ABP通用权限工作流管理系统 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
# set output encoding
$OutputEncoding = [Text.UTF8Encoding]::UTF8
# company name placeholder
$oldCompanyName="MyCompanyName"
# your company name
$newCompanyName="YourCompanyName"
# project name placeholder
$oldProjectName="MyProject"
# your project name
$newProjectName="YourProject"
# file type
$fileType="FileInfo"
# directory type
$dirType="DirectoryInfo"
# copy
Write-Host 'Start copy folders...'
$newRoot=$newCompanyName+"."+$newProjectName
mkdir $newRoot
Copy-Item -Recurse .\aspnet-core\ .\$newRoot\
Copy-Item -Recurse .\vue-element-admin\ .\$newRoot\
Copy-Item .gitignore .\$newRoot\
Copy-Item LICENSE .\$newRoot\
Copy-Item README.md .\$newRoot\
# folders to deal with
$slnFolder = (Get-Item -Path "./$newRoot/aspnet-core/" -Verbose).FullName
$vueFolder = (Get-Item -Path "./$newRoot/vue-element-admin/" -Verbose).FullName
function Rename {
param (
$TargetFolder,
$PlaceHolderCompanyName,
$PlaceHolderProjectName,
$NewCompanyName,
$NewProjectName
)
# file extensions to deal with
$include=@("*.cs","*.cshtml","*.asax","*.ps1","*.ts","*.csproj","*.sln","*.xaml","*.json","*.js","*.xml","*.config","Dockerfile")
$elapsed = [System.Diagnostics.Stopwatch]::StartNew()
Write-Host "[$TargetFolder]Start rename folder..."
# rename folder
Ls $TargetFolder -Recurse | Where { $_.GetType().Name -eq $dirType -and ($_.Name.Contains($PlaceHolderCompanyName) -or $_.Name.Contains($PlaceHolderProjectName)) } | ForEach-Object{
Write-Host 'directory ' $_.FullName
$newDirectoryName=$_.Name.Replace($PlaceHolderCompanyName,$NewCompanyName).Replace($PlaceHolderProjectName,$NewProjectName)
Rename-Item $_.FullName $newDirectoryName
}
Write-Host "[$TargetFolder]End rename folder."
Write-Host '-------------------------------------------------------------'
# replace file content and rename file name
Write-Host "[$TargetFolder]Start replace file content and rename file name..."
Ls $TargetFolder -Include $include -Recurse | Where { $_.GetType().Name -eq $fileType} | ForEach-Object{
$fileText = Get-Content $_ -Raw -Encoding UTF8
if($fileText.Length -gt 0 -and ($fileText.contains($PlaceHolderCompanyName) -or $fileText.contains($PlaceHolderProjectName))){
$fileText.Replace($PlaceHolderCompanyName,$NewCompanyName).Replace($PlaceHolderProjectName,$NewProjectName) | Set-Content $_ -Encoding UTF8
Write-Host 'file(change text) ' $_.FullName
}
If($_.Name.contains($PlaceHolderCompanyName) -or $_.Name.contains($PlaceHolderProjectName)){
$newFileName=$_.Name.Replace($PlaceHolderCompanyName,$NewCompanyName).Replace($PlaceHolderProjectName,$NewProjectName)
Rename-Item $_.FullName $newFileName
Write-Host 'file(change name) ' $_.FullName
}
}
Write-Host "[$TargetFolder]End replace file content and rename file name."
Write-Host '-------------------------------------------------------------'
$elapsed.stop()
write-host "[$TargetFolder]Total Time Cost: $($elapsed.Elapsed.ToString())"
}
Rename -TargetFolder $slnFolder -PlaceHolderCompanyName $oldCompanyName -PlaceHolderProjectName $oldProjectName -NewCompanyName $newCompanyName -NewProjectName $newProjectName
Rename -TargetFolder $vueFolder -PlaceHolderCompanyName $oldCompanyName -PlaceHolderProjectName $oldProjectName -NewCompanyName $newCompanyName -NewProjectName $newProjectName
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。