Skip to content

Commit

Permalink
windows install script
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszgasior committed Jun 23, 2024
1 parent b1c6f61 commit ea6d57a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,22 @@ Therefore, I decided to take this opportunity to create Remove Branches CLI in G

## Installation

Download the app from the Releases page and add it to you $PATH folder.
### Linux/macOS

Download the app from the Releases page and add it to you $PATH folder (/usr/local/bin).
Installation script will be provided soon.

### Windows

To install this tool on Windows, open PowerShell as Administrator and run the following command:

```powershell
iex "& { $(Invoke-WebRequest -Uri 'https://raw.githubusercontent.com/lukaszgasior/remove-branches/main/install.ps1' -UseBasicParsing) }"
```

The app will be installed in `"$env:ProgramFiles\Git\cmd"` folder, so in case of any issues with running this command
make sure this folder is added to your $PATH.

## Usage

After installing the tool, you can use it with the following commands:
Expand Down
11 changes: 1 addition & 10 deletions install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,7 @@ function Test-IsAdmin {
}

if (-not (Test-IsAdmin)) {
Write-Host "Script not running as Administrator. Restarting with elevated privileges..."

if ($PSVersionTable.PSEdition -eq "Core") {
$shell = "pwsh"
}
else {
$shell = "powershell"
}

Start-Process -FilePath $shell -ArgumentList ("-NoProfile -ExecutionPolicy Bypass -File `"" + $($MyInvocation.MyCommand.Path) + "`"") -Verb RunAs
Write-Host "This script needs to be run as an administrator. Exiting..."
exit
}

Expand Down

0 comments on commit ea6d57a

Please sign in to comment.