|
19 | 19 | # It it isn't activated, it will save the currently activated environment, change to codegraph, and restore the original one at the end again. |
20 | 20 | # In cases of an error it might be, that the original conda environment isn't set back. Typically this shouldn't be the case though. |
21 | 21 |
|
22 | | -# Requires juypter nbconvert |
| 22 | +# Requires juypter nbconvert,,operatingSystemFunctions.sh |
23 | 23 |
|
24 | 24 | # Fail on any error ("-e" = exit on first error, "-o pipefail" exist on errors within piped commands) |
25 | 25 | set -eo pipefail |
@@ -85,24 +85,15 @@ backupCondaEnvironment=$CONDA_DEFAULT_ENV |
85 | 85 | echo "executeJupyterNotebook: CODEGRAPH_CONDA_ENVIRONMENT=${CODEGRAPH_CONDA_ENVIRONMENT}" |
86 | 86 | echo "executeJupyterNotebook: Current conda environment=${CONDA_DEFAULT_ENV}" |
87 | 87 |
|
88 | | -isWindows=false |
89 | | -if [[ "$OSTYPE" == "cygwin" ]] || [[ "$OSTYPE" == "msys" ]] || [[ "$OSTYPE" == "win32" ]]; then |
90 | | - isWindows=true |
91 | | - echo "executeJupyterNotebook: Detected isWindows=${isWindows} for operating system type ${OSTYPE}" |
92 | | -fi |
| 88 | +# Include operation system function to for example detect Windows. |
| 89 | +source "${SCRIPTS_DIR}/operatingSystemFunctions.sh" |
93 | 90 |
|
94 | | -scriptExtension="" |
95 | | -if [[ "${isWindows}" = true ]]; then |
96 | | - scriptExtension=".bat" |
97 | | - echo "startNeo4j: Using scriptExtension ${scriptExtension} for Windows." |
98 | | -fi |
| 91 | +scriptExtension=$(ifWindows ".bat" "") |
99 | 92 |
|
100 | 93 | # Determine the path to "conda" |
101 | 94 | if [ -n "${CONDA}" ]; then |
102 | | - if [[ "${isWindows}" = true ]]; then |
| 95 | + if isWindows; then |
103 | 96 | pathToConda="${CONDA}\\Scripts\\" # the trailing backslash character is required |
104 | | - PYTHONWARNINGS="ignore:Unverified HTTPS request" |
105 | | - echo "executeJupyterNotebook: Setting PYTHONWARNINGS=${PYTHONWARNINGS}" |
106 | 97 | else |
107 | 98 | pathToConda="${CONDA}/bin/" # the trailing slash character is required |
108 | 99 | fi |
|
0 commit comments