mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-20 03:06:59 +08:00
73
lib/scripts/patch.ps1
Normal file
73
lib/scripts/patch.ps1
Normal file
@@ -0,0 +1,73 @@
|
||||
param(
|
||||
[string]$platform = ""
|
||||
)
|
||||
|
||||
# TODO: remove
|
||||
# https://github.com/flutter/flutter/issues/182468
|
||||
$ToolTipFix = "56956c33ef102ac0b5fc46b62bd2dd9f50a86616";
|
||||
|
||||
# TODO: remove
|
||||
# https://github.com/flutter/flutter/issues/182281
|
||||
$NewOverScrollIndicator = "362b1de29974ffc1ed6faa826e1df870d7bec75f";
|
||||
|
||||
$BottomSheetPatch = "lib/scripts/bottom_sheet.patch"
|
||||
# TODO: remove
|
||||
# https://github.com/flutter/flutter/issues/90223
|
||||
$ModalBarrierPatch = "lib/scripts/modal_barrier.patch"
|
||||
# TODO: remove
|
||||
# https://github.com/flutter/flutter/issues/182466
|
||||
$MouseCursorPatch = "lib/scripts/mouse_cursor.patch"
|
||||
|
||||
Set-Location $env:FLUTTER_ROOT
|
||||
|
||||
$picks = @()
|
||||
$reverts = @()
|
||||
$patches = @($ModalBarrierPatch, $MouseCursorPatch)
|
||||
|
||||
switch ($platform.ToLower()) {
|
||||
"android" {
|
||||
$reverts += $NewOverScrollIndicator
|
||||
$patches += $BottomSheetPatch
|
||||
}
|
||||
"ios" {}
|
||||
"linux" {
|
||||
$picks += $ToolTipFix
|
||||
}
|
||||
"macos" {
|
||||
$picks += $ToolTipFix
|
||||
}
|
||||
"windows" {
|
||||
$picks += $ToolTipFix
|
||||
}
|
||||
default {}
|
||||
}
|
||||
|
||||
git config --global user.name "ci"
|
||||
git config --global user.email "example@example.com"
|
||||
|
||||
foreach ($pick in $picks) {
|
||||
git stash
|
||||
git cherry-pick $pick --no-edit
|
||||
if ($LASTEXITCODE -eq 0) {
|
||||
git reset --soft HEAD~1
|
||||
Write-Host "$pick picked"
|
||||
}
|
||||
git stash pop
|
||||
}
|
||||
|
||||
foreach ($revert in $reverts) {
|
||||
git stash
|
||||
git revert $revert --no-edit
|
||||
if ($LASTEXITCODE -eq 0) {
|
||||
git reset --soft HEAD~1
|
||||
Write-Host "$revert reverted"
|
||||
}
|
||||
git stash pop
|
||||
}
|
||||
|
||||
foreach ($patch in $patches) {
|
||||
git apply "$env:GITHUB_WORKSPACE/$patch"
|
||||
if ($LASTEXITCODE -eq 0) {
|
||||
Write-Host "$patch applied"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user