mirror of
https://github.com/vczh-libraries/Release.git
synced 2026-05-13 11:58:30 +08:00
...
This commit is contained in:
@@ -1,9 +1,28 @@
|
||||
# Prepare Copilot workspace files
|
||||
|
||||
param(
|
||||
[switch]$Backup
|
||||
[switch]$Backup,
|
||||
[switch]$Earliest
|
||||
)
|
||||
|
||||
if (@($Backup, $Earliest).Where({ $_ }).Count -gt 1) {
|
||||
throw "At most one switch can be true: -Backup, -Earliest."
|
||||
}
|
||||
|
||||
if ($Earliest) {
|
||||
$learningRoot = Resolve-Path -LiteralPath "$PSScriptRoot\..\Learning"
|
||||
$earliestFolder = Get-ChildItem -LiteralPath $learningRoot -Directory |
|
||||
Sort-Object -Property Name |
|
||||
Select-Object -First 1
|
||||
|
||||
if ($null -eq $earliestFolder) {
|
||||
throw "No folder is found in '$learningRoot'."
|
||||
}
|
||||
|
||||
Write-Output $earliestFolder.FullName
|
||||
exit 0
|
||||
}
|
||||
|
||||
# Create or override the markdown files with the specified content
|
||||
$filesToOverride = @{
|
||||
"Copilot_Planning.md" = "# !!!PLANNING!!!"
|
||||
@@ -84,4 +103,4 @@ if ($Backup) {
|
||||
}
|
||||
}
|
||||
|
||||
Write-Host "Copilot preparation completed."
|
||||
Write-Host "Copilot preparation completed."
|
||||
|
||||
Reference in New Issue
Block a user