Skip to content

Commit

Permalink
added warning about reinstalling extensions to help and lab clean o…
Browse files Browse the repository at this point in the history
…utput
  • Loading branch information
telamonian committed Dec 5, 2019
1 parent bff4f75 commit 8cc3dab
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 2 additions & 0 deletions jupyterlab/commands.py
Expand Up @@ -459,6 +459,8 @@ def clean(app_dir=None, logger=None, app_options=None):
logger.info('%s not present, skipping...', name)

logger.info('Success!')
if app_options.all or app_options.extensions:
logger.info('All of your extensions have been removed, and will need to be reinstalled')


def build(app_dir=None, name=None, version=None, static_url=None,
Expand Down
14 changes: 10 additions & 4 deletions jupyterlab/labapp.py
Expand Up @@ -101,11 +101,15 @@ def start(self):
clean_aliases = dict(base_aliases)
clean_aliases['app-dir'] = 'LabCleanApp.app_dir'

ext_warn_msg = "WARNING: this will delete all of your extensions, which will need to be reinstalled"

clean_flags = dict(base_flags)
clean_flags['extensions'] = ({'LabCleanApp': {'extensions': True}}, 'Also delete <app-dir>/extensions')
clean_flags['extensions'] = ({'LabCleanApp': {'extensions': True}},
'Also delete <app-dir>/extensions.\n%s' % ext_warn_msg)
clean_flags['settings'] = ({'LabCleanApp': {'settings': True}}, 'Also delete <app-dir>/settings')
clean_flags['static'] = ({'LabCleanApp': {'static': True}}, 'Also delete <app-dir>/static')
clean_flags['all'] = ({'LabCleanApp': {'all': True}}, 'Delete the entire contents of the app directory')
clean_flags['all'] = ({'LabCleanApp': {'all': True}},
'Delete the entire contents of the app directory.\n%s' % ext_warn_msg)


class LabCleanAppOptions(AppOptions):
Expand Down Expand Up @@ -133,13 +137,15 @@ class LabCleanApp(JupyterApp):

app_dir = Unicode('', config=True, help='The app directory to clean')

extensions = Bool(False, config=True, help="Also delete <app-dir>/extensions")
extensions = Bool(False, config=True,
help="Also delete <app-dir>/extensions.\n%s" % ext_warn_msg)

settings = Bool(False, config=True, help="Also delete <app-dir>/settings")

static = Bool(False, config=True, help="Also delete <app-dir>/static")

all = Bool(False, config=True, help="Delete the entire contents of the app directory")
all = Bool(False, config=True,
help="Delete the entire contents of the app directory.\n%s" % ext_warn_msg)

def start(self):
app_options = LabCleanAppOptions(
Expand Down

0 comments on commit 8cc3dab

Please sign in to comment.