Updated some scripts

This commit is contained in:
Markus Fleschutz 2024-09-24 21:28:31 +02:00
parent db8e7e1766
commit 7e6b42352e
10 changed files with 13 additions and 17 deletions

View File

@ -9,7 +9,7 @@
PS> ./build-repo.ps1 C:\Repos\ninja PS> ./build-repo.ps1 C:\Repos\ninja
Building 📂ninja using CMakeLists.txt into 📂ninja/_Build_Results... Building 📂ninja using CMakeLists.txt into 📂ninja/_Build_Results...
... ...
Built 📂ninja repository in 47 sec. Built 📂ninja repository in 47 sec.
.LINK .LINK
https://github.com/fleschutz/PowerShell https://github.com/fleschutz/PowerShell
.NOTES .NOTES
@ -143,7 +143,7 @@ try {
$repoDirName = (Get-Item "$path").Name $repoDirName = (Get-Item "$path").Name
[int]$elapsed = $stopWatch.Elapsed.TotalSeconds [int]$elapsed = $stopWatch.Elapsed.TotalSeconds
"✔️ Built 📂$repoDirName repository in $elapsed sec." " Built 📂$repoDirName repository in $elapsed sec."
exit 0 # success exit 0 # success
} catch { } catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"

View File

@ -32,7 +32,7 @@ try {
} }
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
"✔️ built $FolderCount Git repositories at 📂$ParentDirName in $Elapsed sec" "✅ Built $FolderCount Git repositories at 📂$ParentDirName in $Elapsed sec"
exit 0 # success exit 0 # success
} catch { } catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"

View File

@ -71,7 +71,7 @@ try {
$repoDirName = (Get-Item "$FullPath").Name $repoDirName = (Get-Item "$FullPath").Name
[int]$elapsed = $stopWatch.Elapsed.TotalSeconds [int]$elapsed = $stopWatch.Elapsed.TotalSeconds
"✔️ Checked 📂$repoDirName repo in $($elapsed)s." " Checked 📂$repoDirName repo in $($elapsed)s."
exit 0 # success exit 0 # success
} catch { } catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"

View File

@ -37,7 +37,7 @@ try {
} }
[int]$elapsed = $stopWatch.Elapsed.TotalSeconds [int]$elapsed = $stopWatch.Elapsed.TotalSeconds
"✔️ Checked all $numFolders Git repos in 📂$parentDir in $($elapsed)s." " Checked all $numFolders Git repos in 📂$parentDir in $($elapsed)s."
exit 0 # success exit 0 # success
} catch { } catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"

View File

@ -46,7 +46,7 @@ try {
if ($lastExitCode -ne "0") { throw "'git clean -xfd -f' in submodules failed with exit code $lastExitCode" } if ($lastExitCode -ne "0") { throw "'git clean -xfd -f' in submodules failed with exit code $lastExitCode" }
} }
[int]$elapsed = $stopWatch.Elapsed.TotalSeconds [int]$elapsed = $stopWatch.Elapsed.TotalSeconds
"✔️ Cleaned $numFolders Git repos under 📂$parentDirName in $elapsed sec" " Cleaned $numFolders Git repos under 📂$parentDirName in $elapsed sec"
exit 0 # success exit 0 # success
} catch { } catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"

View File

@ -63,7 +63,7 @@ try {
} }
} }
[int]$elapsed = $stopWatch.Elapsed.TotalSeconds [int]$elapsed = $stopWatch.Elapsed.TotalSeconds
"✔️ Cloned $cloned additional Git repos into 📂$targetDirName in $($elapsed)s." " Cloned $cloned additional Git repos into 📂$targetDirName in $($elapsed)s."
exit 0 # success exit 0 # success
} catch { } catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"

View File

@ -10,7 +10,7 @@
(1/3) Searching for Git executable... git version 2.41.0.windows.3 (1/3) Searching for Git executable... git version 2.41.0.windows.3
(2/3) Checking local repository... C:\Repos\rust (2/3) Checking local repository... C:\Repos\rust
(3/3) Fetching updates (including submodules)... (3/3) Fetching updates (including submodules)...
Updates fetched into 📂rust repo in 2s. Updates fetched into 📂rust repo in 2s.
.LINK .LINK
https://github.com/fleschutz/PowerShell https://github.com/fleschutz/PowerShell
.NOTES .NOTES
@ -35,7 +35,7 @@ try {
if ($lastExitCode -ne "0") { throw "'git fetch --all' failed with exit code $lastExitCode" } if ($lastExitCode -ne "0") { throw "'git fetch --all' failed with exit code $lastExitCode" }
[int]$elapsed = $stopWatch.Elapsed.TotalSeconds [int]$elapsed = $stopWatch.Elapsed.TotalSeconds
"✔️ Updates fetched into 📂$repoDirName repo in $($elapsed)s." " Updates fetched into 📂$repoDirName repo in $($elapsed)s."
exit 0 # success exit 0 # success
} catch { } catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"

View File

@ -7,11 +7,7 @@
Specifies the path to the parent folder Specifies the path to the parent folder
.EXAMPLE .EXAMPLE
PS> ./fetch-repos.ps1 C:\MyRepos PS> ./fetch-repos.ps1 C:\MyRepos
<<<<<<< HEAD
(1) Searching for Git executable... git version 2.46.0.windows.1 (1) Searching for Git executable... git version 2.46.0.windows.1
=======
(1) Searching for Git executable... git version 2.43.0
>>>>>>> 36da57b4c5fca86904d9c631e9ec0a610338de60
(2) Checking parent folder... 33 subfolders (2) Checking parent folder... 33 subfolders
(3/35) Fetching into 📂curl... (3/35) Fetching into 📂curl...
... ...
@ -48,7 +44,7 @@ try {
$step++ $step++
} }
[int]$elapsed = $stopWatch.Elapsed.TotalSeconds [int]$elapsed = $stopWatch.Elapsed.TotalSeconds
"✔️ Fetched into $numFolders repos under 📂$parentDirPathName in $($elapsed)s." " Fetched into $numFolders repos under 📂$parentDirPathName in $($elapsed)s."
exit 0 # success exit 0 # success
} catch { } catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"

View File

@ -48,7 +48,7 @@ try {
} }
[int]$elapsed = $stopWatch.Elapsed.TotalSeconds [int]$elapsed = $stopWatch.Elapsed.TotalSeconds
if ($failed -eq 0) { if ($failed -eq 0) {
"✔️ Updated $numFolders repos under 📂$parentDirName in $($elapsed)s." " Updated $numFolders repos under 📂$parentDirName in $($elapsed)s."
exit 0 # success exit 0 # success
} else { } else {
"⚠️ Updated $numFolders repos under 📂$parentDirName in $($elapsed)s but $failed failed!" "⚠️ Updated $numFolders repos under 📂$parentDirName in $($elapsed)s but $failed failed!"

View File

@ -11,7 +11,7 @@
(2/4) Checking local repository... 📂C:\MyRepo (2/4) Checking local repository... 📂C:\MyRepo
(3/4) Pulling remote updates... Already up to date. (3/4) Pulling remote updates... Already up to date.
(4/4) Pushing local updates... Everything up-to-date (4/4) Pushing local updates... Everything up-to-date
Synced repo 📂MyRepo in 5 sec Synced repo 📂MyRepo in 5 sec
.LINK .LINK
https://github.com/fleschutz/PowerShell https://github.com/fleschutz/PowerShell
.NOTES .NOTES
@ -40,7 +40,7 @@ try {
if ($lastExitCode -ne "0") { throw "'git push' failed" } if ($lastExitCode -ne "0") { throw "'git push' failed" }
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
"✔️ Synced repo 📂$pathName in $Elapsed sec" " Synced repo 📂$pathName in $Elapsed sec"
exit 0 # success exit 0 # success
} catch { } catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"