-
Notifications
You must be signed in to change notification settings - Fork 60
Fixes for Windows Linux subsystem shell and Cygwin bash #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
34c3601
dd8c2d0
0fb3d2f
867b08d
73fbb2e
030835c
146b85b
724fb0e
7e5c00d
1c6a2ee
fe8c67f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| | ||
| # Script for running 'repo' tool in either Windows Subsystem for Linux's or Cygwin's bash | ||
|
|
||
| Param($command, $path) | ||
|
|
||
| if (Test-Path $path) { | ||
| $cmdPath = Split-Path -parent $PSCommandPath | ||
|
|
||
| #if Windows Subsystem for Linux (WSL) | ||
| if ( $(Get-Command bash).Source -eq "C:\WINDOWS\system32\bash.exe") { | ||
| $path = $path -replace '\\','/' | ||
| $path = $path -replace '.:',"/mnt/c" | ||
|
|
||
| $cmdPath = $cmdPath -replace '\\','/' | ||
| $cmdPath = $cmdPath -replace '.:','/mnt/c' | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a reason why this logic can't be in
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Putting this code in |
||
|
|
||
| bash -l "$cmdPath/repo" $command -f $path | ||
| } | ||
| # if Cygwin is installed and CYGWIN environment variable pointing to its installation location is defined | ||
| elseif (Test-Path env:CYGWIN) { | ||
| $cygwin = "$($env:CYGWIN)\bin\bash.exe" | ||
| $params = '-l',"$cmdPath\repo","$command",'-f',"$path" | ||
| & $cygwin $params | ||
| } | ||
| else { | ||
| Write-Error "'bash' cannot be found. Please install either Windows Subsystem for Linux or Cygwin. If the latter, define CYGWIN environment variable pointing to the installation location." | ||
| exit 2 | ||
| } | ||
| } | ||
| else { | ||
| Write-Error "File $path not found" | ||
| exit 1 | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.