🐛 fix(playbook): enforce rulesets to agents flow
This commit is contained in:
@@ -20,11 +20,6 @@ for %%I in ("%ROOT%") do set "ROOT=%%~fI"
|
||||
for %%I in ("%SCRIPT_DIR%..") do set "SRC=%%~fI"
|
||||
|
||||
set "AGENTS_SRC_ROOT=%SRC%\rulesets"
|
||||
if not exist "%AGENTS_SRC_ROOT%" (
|
||||
if exist "%SRC%\.agents" (
|
||||
set "AGENTS_SRC_ROOT=%SRC%\.agents"
|
||||
)
|
||||
)
|
||||
set "GITATTR_SRC=%SRC%\.gitattributes"
|
||||
|
||||
if not exist "%AGENTS_SRC_ROOT%" (
|
||||
|
||||
@@ -23,12 +23,6 @@ if (-not $Root) {
|
||||
$Root = (Resolve-Path $Root).Path
|
||||
|
||||
$AgentsSrcRoot = Join-Path $Src "rulesets"
|
||||
if (-not (Test-Path $AgentsSrcRoot)) {
|
||||
$legacyAgents = Join-Path $Src ".agents"
|
||||
if (Test-Path $legacyAgents) {
|
||||
$AgentsSrcRoot = $legacyAgents
|
||||
}
|
||||
}
|
||||
$GitAttrSrc = Join-Path $Src ".gitattributes"
|
||||
|
||||
if (-not (Test-Path $AgentsSrcRoot)) {
|
||||
|
||||
@@ -22,9 +22,6 @@ fi
|
||||
ROOT="$(CDPATH= cd -- "$ROOT" && pwd -P)"
|
||||
|
||||
AGENTS_SRC_ROOT="$SRC/rulesets"
|
||||
if [ ! -d "$AGENTS_SRC_ROOT" ] && [ -d "$SRC/.agents" ]; then
|
||||
AGENTS_SRC_ROOT="$SRC/.agents"
|
||||
fi
|
||||
GITATTR_SRC="$SRC/.gitattributes"
|
||||
|
||||
if [ ! -d "$AGENTS_SRC_ROOT" ]; then
|
||||
|
||||
@@ -77,13 +77,6 @@ if errorlevel 1 (
|
||||
|
||||
if not exist "%DEST_PREFIX%\\rulesets" mkdir "%DEST_PREFIX%\\rulesets"
|
||||
copy /y "%SRC%\\rulesets\\index.md" "%DEST_PREFIX%\\rulesets\\index.md" >nul
|
||||
if exist "%SRC%\\.agents" (
|
||||
xcopy "%SRC%\\.agents\\*" "%DEST_PREFIX%\\.agents\\" /e /i /y >nul
|
||||
if errorlevel 1 (
|
||||
echo ERROR: failed to copy .agents
|
||||
exit /b 1
|
||||
)
|
||||
)
|
||||
|
||||
if not exist "%DEST_PREFIX%\\templates" mkdir "%DEST_PREFIX%\\templates"
|
||||
|
||||
|
||||
@@ -77,11 +77,6 @@ Copy-Item (Join-Path $Src "docs/common") $DocsDir -Recurse -Force
|
||||
$AgentsDir = Join-Path $DestPrefix "rulesets"
|
||||
New-Item -ItemType Directory -Path $AgentsDir -Force | Out-Null
|
||||
Copy-Item (Join-Path $Src "rulesets/index.md") (Join-Path $AgentsDir "index.md") -Force
|
||||
# Compatibility: keep a mirrored .agents/ snapshot when present.
|
||||
$LegacyAgents = Join-Path $Src ".agents"
|
||||
if (Test-Path $LegacyAgents) {
|
||||
Copy-Item $LegacyAgents (Join-Path $DestPrefix ".agents") -Recurse -Force
|
||||
}
|
||||
|
||||
$TemplatesDir = Join-Path $DestPrefix "templates"
|
||||
New-Item -ItemType Directory -Path $TemplatesDir -Force | Out-Null
|
||||
|
||||
@@ -84,10 +84,6 @@ cp -R "$SRC/docs/common" "$DEST_PREFIX/docs/"
|
||||
# Copy rulesets
|
||||
mkdir -p "$DEST_PREFIX/rulesets"
|
||||
cp "$SRC/rulesets/index.md" "$DEST_PREFIX/rulesets/index.md"
|
||||
# Compatibility: keep a mirrored .agents/ snapshot when present.
|
||||
if [ -d "$SRC/.agents" ]; then
|
||||
cp -R "$SRC/.agents" "$DEST_PREFIX/"
|
||||
fi
|
||||
|
||||
mkdir -p "$DEST_PREFIX/templates"
|
||||
if [ -d "$SRC/templates/ci" ]; then
|
||||
|
||||
Reference in New Issue
Block a user