mirror of
https://git.ecdf.ed.ac.uk/win_automation/windows-ansible.git
synced 2026-10-30 23:50:15 +00:00
simplifing process
This commit is contained in:
1 parent
e14096aac4
commit
8f2a04e82e
4 files changed
+6
-73
No files matched your search
@@ -1,28 +0,0 @@
|
||||
$bashProfilePath = Join-Path $HOME ".bash_profile"
|
||||
|
||||
$condaPath = "C:\tools\miniforge3\Scripts\conda.exe"
|
||||
|
||||
$requiredLine = 'eval "$(''/C/tools/miniforge3/Scripts/conda.exe'' ''shell.bash'' ''hook'')"'
|
||||
|
||||
if (Test-Path $condaPath) {
|
||||
Write-Host "Miniforge3 is installed at $condaPath"
|
||||
|
||||
if (Test-Path $bashProfilePath) {
|
||||
$currentContent = Get-Content -Path $bashProfilePath -ErrorAction SilentlyContinue
|
||||
|
||||
if ($currentContent -contains $requiredLine) {
|
||||
Write-Host "The required line is already present in .bash_profile"
|
||||
} else {
|
||||
Add-Content -Path $bashProfilePath -Value $requiredLine
|
||||
Write-Host "The required line has been added to .bash_profile"
|
||||
}
|
||||
} else {
|
||||
Set-Content -Path $bashProfilePath -Value $requiredLine -Force
|
||||
Write-Host ".bash_profile created with the required line"
|
||||
}
|
||||
|
||||
Set-ItemProperty -Path $bashProfilePath -Name Attributes -Value ([System.IO.FileAttributes]::Hidden)
|
||||
Write-Host ".bash_profile is set to hidden"
|
||||
} else {
|
||||
Write-Host "Miniforge3 is not installed. Exiting."
|
||||
}
|
||||
Reference in new issue
Block a user