1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/vcs-all-in-one-git-secrets

Присоединиться к Gitlife
Откройте для себя и примите участие в публичных проектах с открытым исходным кодом с участием более 10 миллионов разработчиков. Приватные репозитории также полностью бесплатны :)
Присоединиться бесплатно
Клонировать/Скачать
install.ps1 1.4 КБ
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
Aaron Costley Отправлено 26.07.2018 05:26 635895a
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."

Опубликовать ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://api.gitlife.ru/oschina-mirror/vcs-all-in-one-git-secrets.git
git@api.gitlife.ru:oschina-mirror/vcs-all-in-one-git-secrets.git
oschina-mirror
vcs-all-in-one-git-secrets
vcs-all-in-one-git-secrets
master