Skip to content

Commit

Permalink
fixes #940
Browse files Browse the repository at this point in the history
  • Loading branch information
jph00 committed Aug 26, 2022
1 parent c981c3a commit c09b077
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions nbdev/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,12 @@ def _render_nb(fn, cfg):
@delegates(nbdev_create_config)
def nbdev_new(**kwargs):
"Create an nbdev project."
from fastcore.net import urljson

from ghapi.core import GhApi
nbdev_create_config.__wrapped__(**kwargs)
cfg = get_config()

path = Path()
tag = urljson('https://api.github.com/repos/fastai/nbdev-template/releases/latest')['tag_name']
tag = GhApi().repos.get_latest_release('fastai', 'nbdev-template').tag_name
url = f"https://github.com/fastai/nbdev-template/archive/{tag}.tar.gz"
extract_tgz(url)
tmpl_path = path/f'nbdev-template-{tag}'
Expand Down
5 changes: 2 additions & 3 deletions nbs/09_API/12_cli.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,12 @@
"@delegates(nbdev_create_config)\n",
"def nbdev_new(**kwargs):\n",
" \"Create an nbdev project.\"\n",
" from fastcore.net import urljson\n",
" \n",
" from ghapi.core import GhApi\n",
" nbdev_create_config.__wrapped__(**kwargs)\n",
" cfg = get_config()\n",
"\n",
" path = Path()\n",
" tag = urljson('https://api.github.com/repos/fastai/nbdev-template/releases/latest')['tag_name']\n",
" tag = GhApi().repos.get_latest_release('fastai', 'nbdev-template').tag_name\n",
" url = f\"https://github.com/fastai/nbdev-template/archive/{tag}.tar.gz\"\n",
" extract_tgz(url)\n",
" tmpl_path = path/f'nbdev-template-{tag}'\n",
Expand Down

0 comments on commit c09b077

Please sign in to comment.