Last active
July 2, 2024 06:12
-
-
Save humazed/0d0c5fc7b0bf7c87adfa2cf5f75b2e30 to your computer and use it in GitHub Desktop.
Revisions
-
humazed revised this gist
Aug 24, 2023 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -24,7 +24,7 @@ Get-ChildItem -Path $rootPath -Recurse -Directory | ForEach-Object { Get-ChildItem -Path $currentDir.FullName -Recurse -Include *.apk, *.aab, *.a, *.log, *.tmp, *.bak, *.swp, .DS_Store | Remove-Item -Force # Delete unnecessary folders $foldersToRemove = @("build", "node_modules", "temp") $foldersToRemove | ForEach-Object { $folderPath = Join-Path -Path $currentDir.FullName -ChildPath $_ if (Test-Path $folderPath) { -
humazed created this gist
Apr 29, 2023 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,36 @@ Write-Host "Cleaning up build files in all Flutter and Android projects..." $rootPath = Get-Location Get-ChildItem -Path $rootPath -Recurse -Directory | ForEach-Object { $currentDir = $_ $flutterProject = Join-Path $currentDir.FullName "pubspec.yaml" $androidProject = Join-Path $currentDir.FullName "android\gradlew" if (Test-Path $flutterProject) { Write-Host "Cleaning Flutter project in $($currentDir.FullName)..." Set-Location $currentDir.FullName & flutter clean } if (Test-Path $androidProject) { Write-Host "Cleaning Android project in $($currentDir.FullName)..." Set-Location (Join-Path $currentDir.FullName "android") & .\gradlew clean Set-Location $rootPath } # Delete APK files, AAB files, other build files, and additional useless files Get-ChildItem -Path $currentDir.FullName -Recurse -Include *.apk, *.aab, *.a, *.log, *.tmp, *.bak, *.swp, .DS_Store | Remove-Item -Force # Delete unnecessary folders $foldersToRemove = @("build", "node_modules", "temp", ".gradle", ".idea", "obj") $foldersToRemove | ForEach-Object { $folderPath = Join-Path -Path $currentDir.FullName -ChildPath $_ if (Test-Path $folderPath) { Remove-Item -Recurse -Force $folderPath } } } Write-Host "All done! Build files and other useless files have been cleaned up in all projects."