mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-08-15 23:28:07 +02:00
Updated the manuals
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
Script: *cd-repo.ps1*
|
||||
========================
|
||||
|
||||
This PowerShell script changes the working directory to a Git repository.
|
||||
This PowerShell script changes the working directory to a local Git repository.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
@ -9,7 +9,7 @@ Parameters
|
||||
PS> ./cd-repo.ps1 [[-folderName] <String>] [<CommonParameters>]
|
||||
|
||||
-folderName <String>
|
||||
Specifies the folder name
|
||||
Specifies the Git repository's folder name
|
||||
|
||||
Required? false
|
||||
Position? 1
|
||||
@ -26,7 +26,7 @@ Example
|
||||
-------
|
||||
```powershell
|
||||
PS> ./cd-repo.ps1 rust
|
||||
📂C:\Repos\rust • on Git branch: ## main ... origin/main
|
||||
📂C:\Repos\rust - current branch is: ## main ... origin/main
|
||||
|
||||
```
|
||||
|
||||
@ -45,12 +45,12 @@ Script Content
|
||||
.SYNOPSIS
|
||||
Sets the working directory to a repository
|
||||
.DESCRIPTION
|
||||
This PowerShell script changes the working directory to a Git repository.
|
||||
This PowerShell script changes the working directory to a local Git repository.
|
||||
.PARAMETER folderName
|
||||
Specifies the folder name
|
||||
Specifies the Git repository's folder name
|
||||
.EXAMPLE
|
||||
PS> ./cd-repo.ps1 rust
|
||||
📂C:\Repos\rust • on Git branch: ## main ... origin/main
|
||||
📂C:\Repos\rust - current branch is: ## main ... origin/main
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
@ -60,7 +60,7 @@ Script Content
|
||||
param([string]$folderName = "")
|
||||
|
||||
try {
|
||||
if ("$folderName" -eq "") { $folderName = Read-Host "Enter the folder name" }
|
||||
if ("$folderName" -eq "") { $folderName = Read-Host "Enter the Git repository's folder name" }
|
||||
|
||||
if (Test-Path "$HOME/Repos/" -pathType Container) { # try short name
|
||||
$path = "$HOME/Repos/"
|
||||
@ -80,8 +80,7 @@ try {
|
||||
if (-not(Test-Path "$path" -pathType Container)) { throw "The path to 📂$path doesn't exist (yet)" }
|
||||
$path = Resolve-Path "$path"
|
||||
Set-Location "$path"
|
||||
Write-Host "📂$path • on Git branch: " -noNewline
|
||||
|
||||
Write-Host "📂$path - current branch is: " -noNewline
|
||||
& git status --short --branch --show-stash
|
||||
exit 0 # success
|
||||
} catch {
|
||||
@ -90,4 +89,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-repo.ps1 as of 05/19/2024 10:25:17)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-repo.ps1 as of 08/15/2024 09:50:45)*
|
||||
|
Reference in New Issue
Block a user