master #1

Open
LambOfGod wants to merge 6 commits from LambOfGod/fs25save:master into master
1 changed files with 18 additions and 1 deletions
Showing only changes of commit 5166658647 - Show all commits

View File

@ -1,5 +1,6 @@
param (
[string]$destinationFolder = "../savegame4"
[string]$destinationFolder = "../savegame4",
[string]$branch = "master" # Параметр для ветки, по умолчанию 'master'
)
# Получаем путь к текущей папке (папка скрипта)
@ -10,6 +11,22 @@ if (-not (Test-Path -Path $destinationFolder)) {
New-Item -Path $destinationFolder -ItemType Directory
}
# Переходим в папку скрипта (если это репозиторий Git)
Set-Location -Path $scriptFolder
# Получаем текущую ветку
$currentBranch = git rev-parse --abbrev-ref HEAD
# Пуллим изменения только если мы не на нужной ветке
if ($currentBranch -ne $branch) {
Write-Host "Переключение на ветку '$branch'..."
git checkout $branch
}
# Пуллим последние изменения из удаленного репозитория для указанной ветки
Write-Host "Пуллинг изменений из ветки '$branch'..."
git pull origin $branch
# Получаем все файлы и папки в текущей папке, исключая .git, downloadSaves.ps1 и uploadSaves.ps1
$filesToCopy = Get-ChildItem -Path $scriptFolder -Recurse | Where-Object {
$_.FullName -notmatch '\\\.git' -and