mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-01-15 10:28:55 +01:00
Improve the error messages
This commit is contained in:
parent
e1feb43253
commit
59c4596271
@ -27,11 +27,11 @@ try {
|
|||||||
|
|
||||||
"⏳ Step 2/3: Cleaning repository..."
|
"⏳ Step 2/3: Cleaning repository..."
|
||||||
& git -C "$RepoDir" clean -xfd -f # force + recurse into dirs + don't use the standard ignore rules
|
& git -C "$RepoDir" clean -xfd -f # force + recurse into dirs + don't use the standard ignore rules
|
||||||
if ($lastExitCode -ne "0") { throw "'git clean -xfd -f' failed (exited with $lastExitCode)" }
|
if ($lastExitCode -ne "0") { throw "'git clean -xfd -f' failed with exit code $lastExitCode)" }
|
||||||
|
|
||||||
"⏳ Step 3/3: Cleaning submodules..."
|
"⏳ Step 3/3: Cleaning submodules..."
|
||||||
& git -C "$RepoDir" submodule foreach --recursive git clean -xfd -f
|
& git -C "$RepoDir" submodule foreach --recursive git clean -xfd -f
|
||||||
if ($lastExitCode -ne "0") { throw "'git clean -xfd -f' in submodules failed (exited with $lastExitCode)" }
|
if ($lastExitCode -ne "0") { throw "'git clean -xfd -f' in submodules failed with exit code $lastExitCode)" }
|
||||||
|
|
||||||
$RepoDirName = (get-item "$RepoDir").Name
|
$RepoDirName = (get-item "$RepoDir").Name
|
||||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||||
|
@ -34,10 +34,10 @@ try {
|
|||||||
"⏳ Step $Step/$($FolderCount): Cleaning 📂$FolderName..."
|
"⏳ Step $Step/$($FolderCount): Cleaning 📂$FolderName..."
|
||||||
|
|
||||||
& git -C "$Folder" clean -xfd -f # force + recurse into dirs + don't use the standard ignore rules
|
& git -C "$Folder" clean -xfd -f # force + recurse into dirs + don't use the standard ignore rules
|
||||||
if ($lastExitCode -ne "0") { throw "'git clean -xfd -f' failed" }
|
if ($lastExitCode -ne "0") { throw "'git clean -xfd -f' failed with exit code $lastExitCode" }
|
||||||
|
|
||||||
& git -C "$Folder" submodule foreach --recursive git clean -xfd -f
|
& git -C "$Folder" submodule foreach --recursive git clean -xfd -f
|
||||||
if ($lastExitCode -ne "0") { throw "'git clean -xfd -f' in submodules failed" }
|
if ($lastExitCode -ne "0") { throw "'git clean -xfd -f' in submodules failed with exit code $lastExitCode" }
|
||||||
|
|
||||||
$Step++
|
$Step++
|
||||||
}
|
}
|
||||||
|
@ -33,13 +33,13 @@ try {
|
|||||||
if (($Mode -eq "locally") -or ($Mode -eq "both")) {
|
if (($Mode -eq "locally") -or ($Mode -eq "both")) {
|
||||||
"Removing local tag..."
|
"Removing local tag..."
|
||||||
& git -C "$RepoDir" tag --delete $TagName
|
& git -C "$RepoDir" tag --delete $TagName
|
||||||
if ($lastExitCode -ne "0") { throw "'git tag --delete' failed" }
|
if ($lastExitCode -ne "0") { throw "'git tag --delete' failed with exit code $lastExitCode" }
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($Mode -eq "remote") -or ($Mode -eq "both")) {
|
if (($Mode -eq "remote") -or ($Mode -eq "both")) {
|
||||||
"Removing remote tag..."
|
"Removing remote tag..."
|
||||||
& git -C "$RepoDir" push origin :refs/tags/$TagName
|
& git -C "$RepoDir" push origin :refs/tags/$TagName
|
||||||
if ($lastExitCode -ne "0") { throw "'git push origin' failed" }
|
if ($lastExitCode -ne "0") { throw "'git push origin' failed with exit code $lastExitCode" }
|
||||||
}
|
}
|
||||||
|
|
||||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||||
|
@ -23,21 +23,21 @@ try {
|
|||||||
|
|
||||||
"⏳ Step 3/5: Configuring IPFS..."
|
"⏳ Step 3/5: Configuring IPFS..."
|
||||||
& ipfs config Addresses.API /ip4/0.0.0.0/tcp/5001
|
& ipfs config Addresses.API /ip4/0.0.0.0/tcp/5001
|
||||||
if ($lastExitCode -ne "0") { throw "'ipfs config Addresses.API' failed" }
|
if ($lastExitCode -ne "0") { throw "'ipfs config Addresses.API' failed (exit code $lastExitCode)" }
|
||||||
|
|
||||||
& ipfs config Addresses.Gateway /ip4/0.0.0.0/tcp/8765
|
& ipfs config Addresses.Gateway /ip4/0.0.0.0/tcp/8765
|
||||||
if ($lastExitCode -ne "0") { throw "'ipfs config Addresses.Gateway' failed" }
|
if ($lastExitCode -ne "0") { throw "'ipfs config Addresses.Gateway' failed (exit code $lastExitCode)" }
|
||||||
|
|
||||||
$Hostname = $(hostname)
|
$Hostname = $(hostname)
|
||||||
& ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '[\"http://paris:5001\", \"http://localhost:3000\", \"http://127.0.0.1:5001\", \"https://webui.ipfs.io\"]'
|
& ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '[\"http://paris:5001\", \"http://localhost:3000\", \"http://127.0.0.1:5001\", \"https://webui.ipfs.io\"]'
|
||||||
if ($lastExitCode -ne "0") { throw "'ipfs config Access-Control-Allow-Origin' failed" }
|
if ($lastExitCode -ne "0") { throw "'ipfs config Access-Control-Allow-Origin' failed (exit code $lastExitCode)" }
|
||||||
|
|
||||||
& ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '[\"PUT\", \"POST\"]'
|
& ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '[\"PUT\", \"POST\"]'
|
||||||
if ($lastExitCode -ne "0") { throw "'ipfs config Access-Control-Allow-Methods' failed" }
|
if ($lastExitCode -ne "0") { throw "'ipfs config Access-Control-Allow-Methods' failed (exit code $lastExitCode)" }
|
||||||
""
|
""
|
||||||
"⏳ Step 4/5: Increasing UDP receive buffer size..."
|
"⏳ Step 4/5: Increasing UDP receive buffer size..."
|
||||||
& sudo sysctl -w net.core.rmem_max=2500000
|
& sudo sysctl -w net.core.rmem_max=2500000
|
||||||
if ($lastExitCode -ne "0") { throw "'sysctl' failed" }
|
if ($lastExitCode -ne "0") { throw "'sysctl' failed (exit code $lastExitCode)" }
|
||||||
""
|
""
|
||||||
"⏳ Step 5/5: Starting IPFS daemon..."
|
"⏳ Step 5/5: Starting IPFS daemon..."
|
||||||
# Start-Process nohup 'ipfs daemon'
|
# Start-Process nohup 'ipfs daemon'
|
||||||
|
@ -31,24 +31,24 @@ try {
|
|||||||
if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" }
|
if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" }
|
||||||
|
|
||||||
$Result = (git status)
|
$Result = (git status)
|
||||||
if ($lastExitCode -ne "0") { throw "'git status' failed in $RepoDir" }
|
if ($lastExitCode -ne "0") { throw "'git status' in $RepoDir failed with exit code $lastExitCode" }
|
||||||
if ("$Result" -notmatch "nothing to commit, working tree clean") { throw "Git repository is NOT clean: $Result" }
|
if ("$Result" -notmatch "nothing to commit, working tree clean") { throw "Git repository is NOT clean: $Result" }
|
||||||
|
|
||||||
"⏳ Step 2/5: Fetching latest updates..."
|
"⏳ Step 2/5: Fetching latest updates..."
|
||||||
& git fetch --all --recurse-submodules --prune --prune-tags --force
|
& git fetch --all --recurse-submodules --prune --prune-tags --force
|
||||||
if ($lastExitCode -ne "0") { throw "'git fetch' failed" }
|
if ($lastExitCode -ne "0") { throw "'git fetch --all' failed with exit code $lastExitCode" }
|
||||||
|
|
||||||
"⏳ Step 3/5: Switching branch..."
|
"⏳ Step 3/5: Switching branch..."
|
||||||
& git checkout --recurse-submodules "$BranchName"
|
& git checkout --recurse-submodules "$BranchName"
|
||||||
if ($lastExitCode -ne "0") { throw "'git checkout $BranchName' failed" }
|
if ($lastExitCode -ne "0") { throw "'git checkout $BranchName' failed with exit code $lastExitCode" }
|
||||||
|
|
||||||
"⏳ Step 4/5: Pulling updates..."
|
"⏳ Step 4/5: Pulling updates..."
|
||||||
& git pull --recurse-submodules
|
& git pull --recurse-submodules
|
||||||
if ($lastExitCode -ne "0") { throw "'git pull' failed" }
|
if ($lastExitCode -ne "0") { throw "'git pull' failed with exit code $lastExitCode" }
|
||||||
|
|
||||||
"⏳ Step 5/5: Updating submodules..."
|
"⏳ Step 5/5: Updating submodules..."
|
||||||
& git submodule update --init --recursive
|
& git submodule update --init --recursive
|
||||||
if ($lastExitCode -ne "0") { throw "'git submodule update' failed" }
|
if ($lastExitCode -ne "0") { throw "'git submodule update --init --recursive' failed with exit code $lastExitCode" }
|
||||||
|
|
||||||
$RepoDirName = (get-item "$RepoDir").Name
|
$RepoDirName = (get-item "$RepoDir").Name
|
||||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||||
|
Loading…
Reference in New Issue
Block a user