Skip to content

Commit 5d29ff1

Browse files
committed
fixup! Support executing Jupyter Notebooks on Windows
1 parent 90924ac commit 5d29ff1

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

scripts/executeJupyterNotebook.sh

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# It it isn't activated, it will save the currently activated environment, change to codegraph, and restore the original one at the end again.
2020
# 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.
2121

22-
# Requires juypter nbconvert
22+
# Requires juypter nbconvert,,operatingSystemFunctions.sh
2323

2424
# Fail on any error ("-e" = exit on first error, "-o pipefail" exist on errors within piped commands)
2525
set -eo pipefail
@@ -85,24 +85,15 @@ backupCondaEnvironment=$CONDA_DEFAULT_ENV
8585
echo "executeJupyterNotebook: CODEGRAPH_CONDA_ENVIRONMENT=${CODEGRAPH_CONDA_ENVIRONMENT}"
8686
echo "executeJupyterNotebook: Current conda environment=${CONDA_DEFAULT_ENV}"
8787

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"
9390

94-
scriptExtension=""
95-
if [[ "${isWindows}" = true ]]; then
96-
scriptExtension=".bat"
97-
echo "startNeo4j: Using scriptExtension ${scriptExtension} for Windows."
98-
fi
91+
scriptExtension=$(ifWindows ".bat" "")
9992

10093
# Determine the path to "conda"
10194
if [ -n "${CONDA}" ]; then
102-
if [[ "${isWindows}" = true ]]; then
95+
if isWindows; then
10396
pathToConda="${CONDA}\\Scripts\\" # the trailing backslash character is required
104-
PYTHONWARNINGS="ignore:Unverified HTTPS request"
105-
echo "executeJupyterNotebook: Setting PYTHONWARNINGS=${PYTHONWARNINGS}"
10697
else
10798
pathToConda="${CONDA}/bin/" # the trailing slash character is required
10899
fi

0 commit comments

Comments
 (0)