pinokiod 1.2.12 → 1.2.13

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 +52 -50
  2. package/package.json +1 -1
package/kernel/shell.js CHANGED
@@ -475,7 +475,6 @@ class Shell {
475
475
 
476
476
  // 1. conda
477
477
 
478
- let conda_activation = []
479
478
  if (params.conda) {
480
479
 
481
480
  // 1. conda_path/conda_name/conda_python
@@ -509,58 +508,61 @@ class Shell {
509
508
  }
510
509
  }
511
510
  }
511
+ } else {
512
+ conda_name = "base"
513
+ }
512
514
 
513
- console.log("CONDA STEP 1", { conda: params.conda, conda_path, conda_name, conda_python })
514
-
515
-
516
- // 2. conda_activation
517
- if (conda_path) {
518
- let env_path = path.resolve(params.path, conda_path)
519
- let env_exists = await this.exists(env_path)
520
- if (env_exists) {
521
- conda_activation = [
522
- (this.platform === 'win32' ? 'conda_hook' : `eval "$(conda shell.bash hook)"`),
523
- `conda deactivate`,
524
- `conda deactivate`,
525
- `conda deactivate`,
526
- `conda activate ${env_path}`,
527
- ]
528
- } else {
529
- conda_activation = [
530
- (this.platform === 'win32' ? 'conda_hook' : `eval "$(conda shell.bash hook)"`),
531
- `conda create -y -p ${env_path} ${conda_python}`,
532
- `conda deactivate`,
533
- `conda deactivate`,
534
- `conda deactivate`,
535
- `conda activate ${env_path}`,
536
- ]
537
- }
538
- } else if (conda_name) {
539
- let envs_path = this.kernel.bin.path("miniconda/envs")
540
- let env_path = path.resolve(envs_path, conda_name)
541
- let env_exists = await this.exists(env_path)
542
- if (env_exists) {
543
- conda_activation = [
544
- (this.platform === 'win32' ? 'conda_hook' : `eval "$(conda shell.bash hook)"`),
545
- `conda deactivate`,
546
- `conda deactivate`,
547
- `conda deactivate`,
548
- `conda activate ${conda_name}`,
549
- ]
550
- } else {
551
- conda_activation = [
552
- (this.platform === 'win32' ? 'conda_hook' : `eval "$(conda shell.bash hook)"`),
553
- `conda create -y -n ${conda_name} ${conda_python}`,
554
- `conda deactivate`,
555
- `conda deactivate`,
556
- `conda deactivate`,
557
- `conda activate ${conda_name}`,
558
- ]
559
- }
515
+ console.log("CONDA STEP 1", { conda: params.conda, conda_path, conda_name, conda_python })
516
+
517
+
518
+ // 2. conda_activation
519
+ let conda_activation = []
520
+ if (conda_path) {
521
+ let env_path = path.resolve(params.path, conda_path)
522
+ let env_exists = await this.exists(env_path)
523
+ if (env_exists) {
524
+ conda_activation = [
525
+ (this.platform === 'win32' ? 'conda_hook' : `eval "$(conda shell.bash hook)"`),
526
+ `conda deactivate`,
527
+ `conda deactivate`,
528
+ `conda deactivate`,
529
+ `conda activate ${env_path}`,
530
+ ]
531
+ } else {
532
+ conda_activation = [
533
+ (this.platform === 'win32' ? 'conda_hook' : `eval "$(conda shell.bash hook)"`),
534
+ `conda create -y -p ${env_path} ${conda_python}`,
535
+ `conda deactivate`,
536
+ `conda deactivate`,
537
+ `conda deactivate`,
538
+ `conda activate ${env_path}`,
539
+ ]
540
+ }
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) {
546
+ conda_activation = [
547
+ (this.platform === 'win32' ? 'conda_hook' : `eval "$(conda shell.bash hook)"`),
548
+ `conda deactivate`,
549
+ `conda deactivate`,
550
+ `conda deactivate`,
551
+ `conda activate ${conda_name}`,
552
+ ]
560
553
  } else {
561
- // no conda name or conda path => means don't activate any env
562
- conda_activation = []
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
+ ]
563
562
  }
563
+ } else {
564
+ // no conda name or conda path => means don't activate any env
565
+ conda_activation = []
564
566
  }
565
567
 
566
568
  console.log("CONDA STEP 2", { conda_activation })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "1.2.12",
3
+ "version": "1.2.13",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {