Skip to content

Commit

Permalink
powershell wrapper initial draft
Browse files Browse the repository at this point in the history
  • Loading branch information
kalefranz committed Dec 15, 2017
1 parent 3d8374e commit f3623f3
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions shell/Library/bin/conda.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@

# shell setup would be something like adding
# . [CONDA_ROOT]/Library/bin/conda.ps1
# or
# Get-ChildItem "[CONDA_ROOT]\Library\bin\conda.ps1" | %{.$_}

if ( "${_CONDA_EXE}" -eq "" ) {
$scriptPath = split-path -parent $MyInvocation.MyCommand.Definition
$_CONDA_EXE = "$scriptPath/../../bin/conda"
}


function conda {
switch -r ($args[1]) {
"^activate$" {
Invoke-Expression -Command ($_CONDA_EXE shell.powershell activate $args[2..-1] | Out-String)
break
}
"^deactivate$" {
Invoke-Expression -Command ($_CONDA_EXE shell.powershell deactivate $args[2..-1] | Out-String)
break
}
"^(install|update|remove|uninstall)$" {
$_CONDA_EXE $args[1..-1]
Invoke-Expression -Command ($_CONDA_EXE shell.powershell reactivate | Out-String)
break
}
default {
$_CONDA_EXE $args[1..-1]
break
}
}
}


if ( $MyInvocation.InvocationName -ne '.' ) {
conda $args[1..-1]
}

0 comments on commit f3623f3

Please sign in to comment.