Files
SiMengWebSite_Notes/script/commit-notes.ps1

18 lines
531 B
PowerShell
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 提交笔记站源码变更(尊重 .gitignore不会加入 _publish、dist、PROJECT_BRIEF.local.md 等)
# 用法: .\script\commit-notes.ps1 -m "提交说明"
param(
[Parameter(Mandatory = $true)]
[string] $Message
)
$ErrorActionPreference = "Stop"
$root = Split-Path -Parent $PSScriptRoot
Set-Location $root
git add docs/.vuepress docs/blog .cursor/rules script/commit-notes.ps1
$staged = @(git diff --cached --name-only)
if ($staged.Count -eq 0) {
Write-Host "No staged changes."
exit 0
}
git commit -m $Message