27 lines
662 B
PowerShell
27 lines
662 B
PowerShell
# 大商道扫书入库 - 快速提交脚本
|
|
# 运行后自动 add -> commit -> push
|
|
|
|
$repoDir = Split-Path -Parent $MyInvocation.MyCommand.Path
|
|
$message = $args[0]
|
|
if (-not $message) {
|
|
$message = "自动提交 " + (Get-Date -Format "yyyy-MM-dd HH:mm:ss")
|
|
}
|
|
|
|
Write-Host "=== 提交变更到服务器 ===" -ForegroundColor Cyan
|
|
Set-Location $repoDir
|
|
|
|
git add -A
|
|
$status = git status --porcelain
|
|
if (-not $status) {
|
|
Write-Host "没有需要提交的变更" -ForegroundColor Yellow
|
|
exit 0
|
|
}
|
|
|
|
Write-Host "变更文件:" -ForegroundColor Yellow
|
|
git status --short
|
|
|
|
git commit -m $message
|
|
git push
|
|
|
|
Write-Host "=== 提交完成 ===" -ForegroundColor Green
|