forked from awslabs/git-secrets
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request awslabs#88 from costleya/master
Simply Installation on Windows. Update README.
- Loading branch information
Showing
3 changed files
with
76 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Set the default behavior, in case people don't have core.autocrlf set. | ||
* text=auto | ||
|
||
# Force the bash scripts to be checked out with LF line endings. | ||
git-secrets text eol=lf | ||
git-secrets.1 text eol=lf | ||
test/bats/bin/* text eol=lf | ||
test/bats/libexec/* text eol=lf | ||
*.bats text eol=lf | ||
*.bash text eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
Param([string]$InstallationDirectory = $($Env:USERPROFILE + "\.git-secrets")) | ||
|
||
Write-Host "Checking to see if installation directory already exists..." | ||
if (-not (Test-Path $InstallationDirectory)) | ||
{ | ||
Write-Host "Creating installation directory." | ||
New-Item -ItemType Directory -Path $InstallationDirectory | Out-Null | ||
} | ||
else | ||
{ | ||
Write-Host "Installation directory already exists." | ||
} | ||
|
||
Write-Host "Copying files." | ||
Copy-Item ./git-secrets -Destination $InstallationDirectory -Force | ||
Copy-Item ./git-secrets.1 -Destination $InstallationDirectory -Force | ||
|
||
Write-Host "Checking if directory already exists in Path..." | ||
$currentPath = [Environment]::GetEnvironmentVariable("PATH", "User") | ||
if ($currentPath -notlike "*$InstallationDirectory*") | ||
{ | ||
Write-Host "Adding to path." | ||
$newPath = $currentPath | ||
if(-not ($newPath.EndsWith(";"))) | ||
{ | ||
$newPath = $newPath + ";" | ||
} | ||
$newPath = $newPath + $InstallationDirectory | ||
[Environment]::SetEnvironmentVariable("PATH", $newPath, "User") | ||
} | ||
else | ||
{ | ||
Write-Host "Already in Path." | ||
} | ||
|
||
# Adding to Session | ||
Write-Host "Adding to user session." | ||
$currentSessionPath = $Env:Path | ||
if ($currentSessionPath -notlike "*$InstallationDirectory*") | ||
{ | ||
if(-not ($currentSessionPath.EndsWith(";"))) | ||
{ | ||
$currentSessionPath = $currentSessionPath + ";" | ||
} | ||
$Env:Path = $currentSessionPath + $InstallationDirectory | ||
} | ||
|
||
Write-Host "Done." |