chore(M00-A): 建立单仓库基线和参考清单
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$expectedRoot = "D:\qipai"
|
||||
$current = (Resolve-Path ".").Path
|
||||
if ($current -ne $expectedRoot) {
|
||||
throw "Workspace must be $expectedRoot, actual: $current"
|
||||
}
|
||||
|
||||
$gitRoot = (& git rev-parse --show-toplevel) -replace '/', '\'
|
||||
if ($gitRoot -ne $expectedRoot) {
|
||||
throw "Git root must be $expectedRoot, actual: $gitRoot"
|
||||
}
|
||||
|
||||
$branch = & git branch --show-current
|
||||
if ($branch -ne "main") {
|
||||
throw "Branch must be main, actual: $branch"
|
||||
}
|
||||
|
||||
$origin = & git remote get-url origin
|
||||
if ($origin -ne "ssh://git@git.txyundm.cn:2222/panda/qipai.git") {
|
||||
throw "Invalid origin: $origin"
|
||||
}
|
||||
|
||||
Write-Host "PASS: workspace, git root, branch and origin are valid."
|
||||
Reference in New Issue
Block a user