mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-03-25 05:26:47 +01:00
Improve the scripts
This commit is contained in:
parent
139ceab42f
commit
41ccb7867b
@ -10,7 +10,6 @@ try {
|
||||
$TargetDir = resolve-path "$HOME/Downloads/"
|
||||
set-location "$TargetDir"
|
||||
"📂 $TargetDir"
|
||||
""
|
||||
exit 0
|
||||
} catch {
|
||||
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
|
@ -10,7 +10,6 @@ try {
|
||||
$TargetDir = resolve-path "$HOME/"
|
||||
set-location "$TargetDir"
|
||||
"📂 $TargetDir"
|
||||
""
|
||||
exit 0
|
||||
} catch {
|
||||
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
|
@ -10,7 +10,6 @@ try {
|
||||
$TargetDir = resolve-path "$HOME/Music/"
|
||||
set-location "$TargetDir"
|
||||
"📂 $TargetDir"
|
||||
""
|
||||
exit 0
|
||||
} catch {
|
||||
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
|
@ -10,7 +10,6 @@ try {
|
||||
$TargetDir = resolve-path "$HOME/Repos/"
|
||||
set-location "$TargetDir"
|
||||
"📂 $TargetDir"
|
||||
""
|
||||
exit 0
|
||||
} catch {
|
||||
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
|
@ -14,7 +14,6 @@ try {
|
||||
}
|
||||
set-location "$TargetDir"
|
||||
"📂 $TargetDir"
|
||||
""
|
||||
exit 0
|
||||
} catch {
|
||||
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
|
@ -10,7 +10,6 @@ try {
|
||||
$TargetDir = resolve-path "$PSScriptRoot/"
|
||||
set-location "$TargetDir"
|
||||
"📂 $TargetDir"
|
||||
""
|
||||
exit 0
|
||||
} catch {
|
||||
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
|
@ -19,7 +19,7 @@ write-host ""
|
||||
|
||||
# function prompt { "$ " } # result is: $
|
||||
|
||||
function prompt { return "💲 " } # result is: 💲
|
||||
function prompt { "`n💲 " } # result is: 💲
|
||||
|
||||
|
||||
# My Alias Names (sorted alphabetically)
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/usr/bin/pwsh
|
||||
<#
|
||||
.SYNTAX pull-repo.ps1 [<repo-dir>]
|
||||
.DESCRIPTION pulls updates for the current/given Git repository (including submodules)
|
||||
.DESCRIPTION pulls updates a Git repository (including submodules)
|
||||
.LINK https://github.com/fleschutz/PowerShell
|
||||
.NOTES Author: Markus Fleschutz / License: CC0
|
||||
#>
|
||||
@ -14,13 +14,13 @@ try {
|
||||
if (-not(test-path "$RepoDir" -pathType container)) { throw "Can't access directory: $RepoDir" }
|
||||
set-location "$RepoDir"
|
||||
|
||||
$Null = (git --version)
|
||||
if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" }
|
||||
|
||||
& git pull --all --recurse-submodules --jobs=4
|
||||
if ($lastExitCode -ne "0") { throw "'git pull' failed" }
|
||||
|
||||
& git status
|
||||
if ($lastExitCode -ne "0") { throw "'git status' failed" }
|
||||
|
||||
write-host -foregroundColor green "✔️ Updates pulled for Git repository $RepoDir"
|
||||
"✔️ Git repository $RepoDir is up to date"
|
||||
exit 0
|
||||
} catch {
|
||||
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
|
@ -12,7 +12,8 @@ try {
|
||||
|
||||
copy-item "$PathToRepo/Scripts/my-profile.ps1" "$PathToProfile" -force
|
||||
|
||||
write-host -foregroundColor green "✔️ PowerShell profile 'CurrentUserCurrentHost' updated - gets active on next login"
|
||||
"✔️ PowerShell profile 'CurrentUserCurrentHost' updated by my-profile.ps1 - it gets active on next login"
|
||||
""
|
||||
exit 0
|
||||
} catch {
|
||||
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
|
Loading…
Reference in New Issue
Block a user