Skip to content

Commit 126e724

Browse files
committed
style: 修复代码格式问题和拼写错误
- 将 switch 语句中的 Default 改为小写 default - 修正 package.json 中脚本路径的拼写错误(srcipts -> scripts) - 调整 git.psm1 中管道的缩进格式 - 统一 git.Tests.ps1 中数组元素的空格格式 - 修复 env.psm1 中 else 的换行格式和函数导出的逗号空格
1 parent 400f649 commit 126e724

5 files changed

Lines changed: 8 additions & 7 deletions

File tree

‎config/vscode/concatSettings.ps1‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ switch ($Mode) {
7777
$settingsList.Add($jsoncString)
7878
}
7979
}
80-
Default {}
80+
default {}
8181
}
8282

8383

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"type": "module",
77
"scripts": {
88
"prepare": "husky",
9-
"format:pwsh": "pwsh -File ./srcipts/Format-PowerShellCode.ps1 -Path . -Recurse",
9+
"format:pwsh": "pwsh -File ./scripts/Format-PowerShellCode.ps1 -Path . -Recurse",
1010
"format:biome": "biome format --write .",
1111
"format": "pnpm format:pwsh",
1212
"pwsh:install": "pwsh -File ./install.ps1",

‎psutils/modules/env.psm1‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,8 @@ function Sync-PathFromBash {
485485
# 将新路径追加到现有的 PowerShell PATH 后面
486486
$env:PATH = "$($env:PATH)$separator$pathsToAdd"
487487
Write-Information "PowerShell PATH 已成功更新!"
488-
} else {
488+
}
489+
else {
489490
Write-Information "Power-Shell 的 PATH 与 Bash 完全同步,无需操作。"
490491
}
491492
}
@@ -495,4 +496,4 @@ function Sync-PathFromBash {
495496
}
496497

497498

498-
Export-ModuleMember -Function Get-Dotenv, Install-Dotenv,Import-EnvPath, Set-EnvPath, Add-EnvPath, Get-EnvParam, Remove-FromEnvPath,Sync-PathFromBash
499+
Export-ModuleMember -Function Get-Dotenv, Install-Dotenv, Import-EnvPath, Set-EnvPath, Add-EnvPath, Get-EnvParam, Remove-FromEnvPath, Sync-PathFromBash

‎psutils/modules/git.psm1‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ function New-7ZipExcludeArgs {
7979
}
8080

8181
$all = @($normalizedBase + $gitPatterns + $normalizedAdditional) |
82-
Where-Object { -not [string]::IsNullOrWhiteSpace($_) } |
83-
Select-Object -Unique
82+
Where-Object { -not [string]::IsNullOrWhiteSpace($_) } |
83+
Select-Object -Unique
8484

8585
$excludeArgs = $all | ForEach-Object { "-xr!$_" }
8686
return $excludeArgs

‎psutils/tests/git.Tests.ps1‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Describe 'Git 模块函数' {
5353
}
5454

5555
It '应合并基础、gitignore 和额外排除并去重' {
56-
$args = New-7ZipExcludeArgs -GitIgnorePath $gitIgnore -AdditionalExcludes @('dist','build/*.tmp','logs')
56+
$args = New-7ZipExcludeArgs -GitIgnorePath $gitIgnore -AdditionalExcludes @('dist', 'build/*.tmp', 'logs')
5757
($args) | Should -Not -Be $null
5858
foreach ($a in $args) { $a | Should -Match '^-xr!.+' }
5959
$args | Should -Contain '-xr!node_modules'

0 commit comments

Comments
 (0)