pinokiod 3.19.38 → 3.19.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/kernel/shell.js +19 -6
- package/package.json +1 -1
package/kernel/shell.js
CHANGED
|
@@ -635,6 +635,17 @@ class Shell {
|
|
|
635
635
|
return ""
|
|
636
636
|
}
|
|
637
637
|
}
|
|
638
|
+
conda_hook () {
|
|
639
|
+
if (this.platform === "win32") {
|
|
640
|
+
if (/bash/i.test(this.shell)) {
|
|
641
|
+
return "source conda.sh"
|
|
642
|
+
} else {
|
|
643
|
+
return "conda_hook"
|
|
644
|
+
}
|
|
645
|
+
} else {
|
|
646
|
+
return `eval "$(conda shell.bash hook)"`
|
|
647
|
+
}
|
|
648
|
+
}
|
|
638
649
|
async activate(params) {
|
|
639
650
|
|
|
640
651
|
// conda and venv can coexist
|
|
@@ -715,12 +726,14 @@ class Shell {
|
|
|
715
726
|
timeout = 'sleep 1'
|
|
716
727
|
}
|
|
717
728
|
|
|
729
|
+
|
|
730
|
+
let conda_hook = this.conda_hook()
|
|
718
731
|
let conda_activation = []
|
|
719
732
|
if (conda_activate) {
|
|
720
733
|
if (typeof conda_activate === "string") {
|
|
721
734
|
if (conda_activate === "minimal") {
|
|
722
735
|
conda_activation = [
|
|
723
|
-
|
|
736
|
+
conda_hook,
|
|
724
737
|
'conda activate base',
|
|
725
738
|
]
|
|
726
739
|
}
|
|
@@ -732,7 +745,7 @@ class Shell {
|
|
|
732
745
|
let env_exists = await this.exists(env_path)
|
|
733
746
|
if (env_exists) {
|
|
734
747
|
conda_activation = [
|
|
735
|
-
|
|
748
|
+
conda_hook,
|
|
736
749
|
`conda deactivate`,
|
|
737
750
|
`conda deactivate`,
|
|
738
751
|
`conda deactivate`,
|
|
@@ -742,7 +755,7 @@ class Shell {
|
|
|
742
755
|
]
|
|
743
756
|
} else {
|
|
744
757
|
conda_activation = [
|
|
745
|
-
|
|
758
|
+
conda_hook,
|
|
746
759
|
`conda create -y -p ${env_path} ${conda_python} ${conda_args ? conda_args : ''}`,
|
|
747
760
|
`conda deactivate`,
|
|
748
761
|
`conda deactivate`,
|
|
@@ -755,7 +768,7 @@ class Shell {
|
|
|
755
768
|
} else if (conda_name) {
|
|
756
769
|
if (conda_name === "base") {
|
|
757
770
|
conda_activation = [
|
|
758
|
-
|
|
771
|
+
conda_hook,
|
|
759
772
|
`conda deactivate`,
|
|
760
773
|
`conda deactivate`,
|
|
761
774
|
`conda deactivate`,
|
|
@@ -769,7 +782,7 @@ class Shell {
|
|
|
769
782
|
let env_exists = await this.exists(env_path)
|
|
770
783
|
if (env_exists) {
|
|
771
784
|
conda_activation = [
|
|
772
|
-
|
|
785
|
+
conda_hook,
|
|
773
786
|
`conda deactivate`,
|
|
774
787
|
`conda deactivate`,
|
|
775
788
|
`conda deactivate`,
|
|
@@ -779,7 +792,7 @@ class Shell {
|
|
|
779
792
|
]
|
|
780
793
|
} else {
|
|
781
794
|
conda_activation = [
|
|
782
|
-
|
|
795
|
+
conda_hook,
|
|
783
796
|
`conda create -y -n ${conda_name} ${conda_python} ${conda_args ? conda_args : ''}`,
|
|
784
797
|
`conda deactivate`,
|
|
785
798
|
`conda deactivate`,
|