pinokiod 1.2.13 → 1.2.15

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.
Files changed (2) hide show
  1. package/kernel/shell.js +25 -15
  2. package/package.json +1 -1
package/kernel/shell.js CHANGED
@@ -474,13 +474,13 @@ class Shell {
474
474
 
475
475
 
476
476
  // 1. conda
477
+ let conda_path
478
+ let conda_name
479
+ let conda_python = "python=3.10"
477
480
 
478
481
  if (params.conda) {
479
482
 
480
483
  // 1. conda_path/conda_name/conda_python
481
- let conda_path
482
- let conda_name
483
- let conda_python = "python=3.10"
484
484
  if (typeof params.conda === "string") {
485
485
  // params.conda => interpret as path
486
486
  conda_path = params.conda
@@ -539,10 +539,7 @@ class Shell {
539
539
  ]
540
540
  }
541
541
  } else if (conda_name) {
542
- let envs_path = this.kernel.bin.path("miniconda/envs")
543
- let env_path = path.resolve(envs_path, conda_name)
544
- let env_exists = await this.exists(env_path)
545
- if (env_exists) {
542
+ if (conda_name === "base") {
546
543
  conda_activation = [
547
544
  (this.platform === 'win32' ? 'conda_hook' : `eval "$(conda shell.bash hook)"`),
548
545
  `conda deactivate`,
@@ -551,14 +548,27 @@ class Shell {
551
548
  `conda activate ${conda_name}`,
552
549
  ]
553
550
  } else {
554
- conda_activation = [
555
- (this.platform === 'win32' ? 'conda_hook' : `eval "$(conda shell.bash hook)"`),
556
- `conda create -y -n ${conda_name} ${conda_python}`,
557
- `conda deactivate`,
558
- `conda deactivate`,
559
- `conda deactivate`,
560
- `conda activate ${conda_name}`,
561
- ]
551
+ let envs_path = this.kernel.bin.path("miniconda/envs")
552
+ let env_path = path.resolve(envs_path, conda_name)
553
+ let env_exists = await this.exists(env_path)
554
+ if (env_exists) {
555
+ conda_activation = [
556
+ (this.platform === 'win32' ? 'conda_hook' : `eval "$(conda shell.bash hook)"`),
557
+ `conda deactivate`,
558
+ `conda deactivate`,
559
+ `conda deactivate`,
560
+ `conda activate ${conda_name}`,
561
+ ]
562
+ } else {
563
+ conda_activation = [
564
+ (this.platform === 'win32' ? 'conda_hook' : `eval "$(conda shell.bash hook)"`),
565
+ `conda create -y -n ${conda_name} ${conda_python}`,
566
+ `conda deactivate`,
567
+ `conda deactivate`,
568
+ `conda deactivate`,
569
+ `conda activate ${conda_name}`,
570
+ ]
571
+ }
562
572
  }
563
573
  } else {
564
574
  // no conda name or conda path => means don't activate any env
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "1.2.13",
3
+ "version": "1.2.15",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {