reverse-skills-max: initial public release (restored, redacted, hardened)
This commit is contained in:
1040
reverse-skill-repo/skills/scripts/lib/ToolDiscovery.ps1
Normal file
1040
reverse-skill-repo/skills/scripts/lib/ToolDiscovery.ps1
Normal file
File diff suppressed because it is too large
Load Diff
33
reverse-skill-repo/skills/scripts/lib/WorkRoot.ps1
Normal file
33
reverse-skill-repo/skills/scripts/lib/WorkRoot.ps1
Normal file
@@ -0,0 +1,33 @@
|
||||
Set-StrictMode -Version Latest
|
||||
|
||||
function Resolve-ReverseProjectRoot {
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
[AllowEmptyString()]
|
||||
[string]$RequestedRoot = ''
|
||||
)
|
||||
|
||||
$root = if ([string]::IsNullOrWhiteSpace($RequestedRoot)) {
|
||||
(Get-Location).ProviderPath
|
||||
} else {
|
||||
$RequestedRoot
|
||||
}
|
||||
|
||||
if ([string]::IsNullOrWhiteSpace($root)) {
|
||||
throw 'Unable to resolve the analysis project root.'
|
||||
}
|
||||
|
||||
if (-not (Test-Path -LiteralPath $root)) {
|
||||
New-Item -ItemType Directory -Force -Path $root | Out-Null
|
||||
}
|
||||
if (-not (Test-Path -LiteralPath $root -PathType Container)) {
|
||||
throw "Project root is not a directory: $root"
|
||||
}
|
||||
|
||||
$item = Get-Item -LiteralPath $root
|
||||
if ($item.PSProvider.Name -ne 'FileSystem') {
|
||||
throw "Project root must use the FileSystem provider: $root"
|
||||
}
|
||||
|
||||
return $item.FullName
|
||||
}
|
||||
Reference in New Issue
Block a user