snow/build/build_project2tar.ps1

27 lines
704 B
PowerShell
Raw 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.

$tarName = "Snow.tar"
# 脚本当前目录build文件夹
$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Definition
# 上一级目录snow根目录
$parentDir = Split-Path -Parent $scriptDir
# tar包的完整路径
$tarPath = Join-Path $parentDir $tarName
# 如果存在旧tar包删除
if (Test-Path $tarPath) {
Remove-Item $tarPath
}
Write-Output "正在创建新的 $tarName$parentDir ..."
# 打包:先切换到 org\jcnc 目录下再压缩 snow 文件夹
& tar -cf $tarPath -C "$scriptDir\..\src\main\java\org\jcnc" snow
if (Test-Path $tarPath) {
Write-Output "✅ 成功创建 $tarName"
} else {
Write-Output "❌ 创建失败,请检查 tar 命令"
}