2 Star 5 Fork 0

Git工具集/git-secrets

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
install.ps1 1.37 KB
一键复制 编辑 原始数据 按行查看 历史
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."
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Shell
1
https://gitee.com/vcs-all-in-one/git-secrets.git
git@gitee.com:vcs-all-in-one/git-secrets.git
vcs-all-in-one
git-secrets
git-secrets
master

搜索帮助