Skip to content

Instantly share code, notes, and snippets.

@astrofrog
Created June 18, 2019 12:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save astrofrog/0f802ab43b191e3b7f439b8690727111 to your computer and use it in GitHub Desktop.
Save astrofrog/0f802ab43b191e3b7f439b8690727111 to your computer and use it in GitHub Desktop.
import os
import click
import shutil
@click.command()
@click.option('--notebook', required=True)
@click.option('--template', required=True)
@click.option('--app', required=True)
def make_app(notebook, template, app):
if os.path.exists(app):
shutil.rmtree(app)
shutil.copytree('templates/base_app.app', app)
shutil.copytree('templates/{0}'.format(template), app + '/Contents/MacOS/share/jupyter/voila/templates/custom')
shutil.copytree('templates/default'.format(template), app + '/Contents/MacOS/share/jupyter/voila/templates/default')
shutil.copy(notebook.format(template), app + '/Contents/MacOS/app_notebooks/mountable2.ipynb')
if __name__ == '__main__':
make_app()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment