dsh-config-sync-plugin 0.4.6 → 0.4.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -248,7 +248,10 @@ function Get-AppRootLeaf([string]$appRoot) {
|
|
|
248
248
|
function Get-AppRootPattern([string]$appRoot) {
|
|
249
249
|
$leaf = Get-AppRootLeaf $appRoot
|
|
250
250
|
# 匹配 [盘符]:[\...\]<末级目录名>,含 JSON 双反斜杠写法;不匹配 <名字>-xxx 这类更长的目录
|
|
251
|
-
|
|
251
|
+
# 关键修正:排除反斜杠边界,避免吞掉 JSON 里的 \"
|
|
252
|
+
# (?<![A-Za-z0-9_\]) 排除前置反斜杠;(?![\w-\]) 排除后置反斜杠
|
|
253
|
+
# [^\s"',;()\[\]\\] 排除路径字符类里的反斜杠
|
|
254
|
+
return ('(?i)(?<![A-Za-z0-9_\\])[A-Z]:[\\/]+(?:[^\s"''`,;()\[\]\\]*[\\/]+)?' + [regex]::Escape($leaf) + '(?![\w-\\])(?:[\\/]+)?')
|
|
252
255
|
}
|
|
253
256
|
|
|
254
257
|
function Get-AppRootFwd([string]$appRoot) {
|