pinokiod 3.19.37 → 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.
Files changed (2) hide show
  1. package/kernel/shell.js +28 -6
  2. package/package.json +1 -1
package/kernel/shell.js CHANGED
@@ -569,6 +569,15 @@ class Shell {
569
569
  // let m = params.message + delimiter + `echo "FINISHED: ${params.message}"\r\n`
570
570
  // return m
571
571
  } else if (Array.isArray(params.message)) {
572
+
573
+ let message = []
574
+ for(let i=0; i<params.message.length; i++) {
575
+ message.push(params.message[i])
576
+ message.push(`echo #${i}`)
577
+ }
578
+ params.message = message
579
+
580
+
572
581
  // params.message.push(`echo "SHELL FINISHED RUNNING"\r\n`)
573
582
  // if params.message is empty, filter out
574
583
  //let delimiter = " && "
@@ -626,6 +635,17 @@ class Shell {
626
635
  return ""
627
636
  }
628
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
+ }
629
649
  async activate(params) {
630
650
 
631
651
  // conda and venv can coexist
@@ -706,12 +726,14 @@ class Shell {
706
726
  timeout = 'sleep 1'
707
727
  }
708
728
 
729
+
730
+ let conda_hook = this.conda_hook()
709
731
  let conda_activation = []
710
732
  if (conda_activate) {
711
733
  if (typeof conda_activate === "string") {
712
734
  if (conda_activate === "minimal") {
713
735
  conda_activation = [
714
- (this.shell === 'cmd.exe' ? 'conda_hook' : `eval "$(conda shell.bash hook)"`),
736
+ conda_hook,
715
737
  'conda activate base',
716
738
  ]
717
739
  }
@@ -723,7 +745,7 @@ class Shell {
723
745
  let env_exists = await this.exists(env_path)
724
746
  if (env_exists) {
725
747
  conda_activation = [
726
- (this.shell === 'cmd.exe' ? 'conda_hook' : `eval "$(conda shell.bash hook)"`),
748
+ conda_hook,
727
749
  `conda deactivate`,
728
750
  `conda deactivate`,
729
751
  `conda deactivate`,
@@ -733,7 +755,7 @@ class Shell {
733
755
  ]
734
756
  } else {
735
757
  conda_activation = [
736
- (this.shell === 'cmd.exe' ? 'conda_hook' : `eval "$(conda shell.bash hook)"`),
758
+ conda_hook,
737
759
  `conda create -y -p ${env_path} ${conda_python} ${conda_args ? conda_args : ''}`,
738
760
  `conda deactivate`,
739
761
  `conda deactivate`,
@@ -746,7 +768,7 @@ class Shell {
746
768
  } else if (conda_name) {
747
769
  if (conda_name === "base") {
748
770
  conda_activation = [
749
- (this.shell === 'cmd.exe' ? 'conda_hook' : `eval "$(conda shell.bash hook)"`),
771
+ conda_hook,
750
772
  `conda deactivate`,
751
773
  `conda deactivate`,
752
774
  `conda deactivate`,
@@ -760,7 +782,7 @@ class Shell {
760
782
  let env_exists = await this.exists(env_path)
761
783
  if (env_exists) {
762
784
  conda_activation = [
763
- (this.shell === 'cmd.exe' ? 'conda_hook' : `eval "$(conda shell.bash hook)"`),
785
+ conda_hook,
764
786
  `conda deactivate`,
765
787
  `conda deactivate`,
766
788
  `conda deactivate`,
@@ -770,7 +792,7 @@ class Shell {
770
792
  ]
771
793
  } else {
772
794
  conda_activation = [
773
- (this.shell === 'cmd.exe' ? 'conda_hook' : `eval "$(conda shell.bash hook)"`),
795
+ conda_hook,
774
796
  `conda create -y -n ${conda_name} ${conda_python} ${conda_args ? conda_args : ''}`,
775
797
  `conda deactivate`,
776
798
  `conda deactivate`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "3.19.37",
3
+ "version": "3.19.39",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {