File tree Expand file tree Collapse file tree 3 files changed +30
-2
lines changed Expand file tree Collapse file tree 3 files changed +30
-2
lines changed Original file line number Diff line number Diff line change @@ -356,6 +356,7 @@ def get_build_scripts(self):
356356 You can use environment variable substitutions in both the
357357 username and the execution script.
358358 """
359+
359360 return []
360361
361362 def get_assemble_scripts (self ):
@@ -520,9 +521,35 @@ class BaseImage(BuildPack):
520521 def get_build_env (self ):
521522 """Return env directives required for build"""
522523 return [
523- ("APP_BASE" , "/srv" )
524+ ("APP_BASE" , "/srv" ),
525+ ('NPM_DIR' , '${APP_BASE}/npm' ),
526+ ('NPM_CONFIG_GLOBALCONFIG' ,'${NPM_DIR}/npmrc' )
527+ ]
528+
529+ def get_path (self ):
530+ return super ().get_path () + [
531+ '${NPM_DIR}/bin'
524532 ]
525533
534+ def get_build_scripts (self ):
535+ scripts = [
536+ (
537+ "root" ,
538+ r"""
539+ mkdir -p ${NPM_DIR} && \
540+ chown -R ${NB_USER}:${NB_USER} ${NPM_DIR}
541+ """
542+ ),
543+ (
544+ "${NB_USER}" ,
545+ r"""
546+ npm config --global set prefix ${NPM_DIR}
547+ """
548+ ),
549+ ]
550+
551+ return super ().get_build_scripts () + scripts
552+
526553 def get_env (self ):
527554 """Return env directives to be set after build"""
528555 env = []
@@ -541,7 +568,6 @@ def get_env(self):
541568 ])
542569 return env
543570
544-
545571 def detect (self ):
546572 return True
547573
Original file line number Diff line number Diff line change 11#! /bin/bash
22jupyter nbextension enable --py --sys-prefix ipyleaflet
3+ npm install --global configurable-http-proxy
Original file line number Diff line number Diff line change 11#! /bin/bash
22set -euo pipefail
33jupyter nbextension list | grep ' jupyter-leaflet' | grep enabled
4+ which configurable-http-proxy
You can’t perform that action at this time.
0 commit comments