-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.ps1
37 lines (27 loc) · 1.42 KB
/
setup.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
$scriptPath = split-path -parent $MyInvocation.MyCommand.Definition
Write-Output "Installing..."
if ((Get-Command tar -errorAction SilentlyContinue) -AND (Get-Command bzip2 -errorAction SilentlyContinue))
{
Write-Output "Downloading Micromamba..."
Invoke-Webrequest -URI https://micro.mamba.pm/api/micromamba/win-64/latest -OutFile mamba\micromamba.tar.bz2
Write-Output "Extracting..."
tar xfC mamba\micromamba.tar.bz2 mamba\
Write-Output "Cleaning up..."
Remove-Item mamba\micromamba.tar.bz2
} else {
Write-Output "Downloading Micromamba..."
(New-Object Net.WebClient).DownloadFile('https://murch.physics.wustl.edu/remote/archive/micromamba.zip', 'mamba\micromamba.zip')
Write-Output "Extracting..."
Expand-Archive mamba\micromamba.zip -DestinationPath mamba\
Write-Output "Cleaning up..."
Remove-Item mamba\micromamba.zip
}
Move-Item -Force mamba\Library\bin\micromamba.exe mamba\micromamba.exe
Remove-Item -Recurse -Force mamba\Library\
Remove-Item -Recurse -Force mamba\info\
Write-Output "Installing base environment..."
$Env:MAMBA_ROOT_PREFIX = Join-Path -Path $scriptPath -ChildPath "mamba"
$Env:MAMBA_EXE = Join-Path -Path $Env:MAMBA_ROOT_PREFIX -ChildPath "micromamba.exe"
(& $Env:MAMBA_EXE 'shell' 'hook' -s 'powershell' -p $Env:MAMBA_ROOT_PREFIX) | Out-String | Invoke-Expression
micromamba -r "$Env:MAMBA_ROOT_PREFIX" create -y -n mambabase38 --file mamba\mambabase38.yml
# Start-Sleep 60