Skip to content

Commit 20a421d

Browse files
committed
undo additions to autogenerated cli.py file
1 parent 43d69a8 commit 20a421d

File tree

1 file changed

+5
-20
lines changed

1 file changed

+5
-20
lines changed

nbdev/cli.py

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -86,27 +86,12 @@ def nbdev_new(**kwargs):
8686
_update_repo_meta(cfg)
8787

8888
path = Path()
89-
90-
_ORG_OR_USR = 'fastai'
91-
_REPOSITORY = 'nbdev-template'
92-
_TEMPLATE = f'{_ORG_OR_USR}/{_TEMPLATE}'
93-
template = kwargs.get('template', _TEMPLATE)
94-
try:
95-
org_or_usr, repo = template.split('/')
96-
except ValueError:
97-
org_or_usr, repo = _ORG_OR_USR, _REPOSITORY
98-
99-
100-
tag = kwargs.get('tag', None)
101-
if tag is None:
102-
with warnings.catch_warnings():
103-
warnings.simplefilter('ignore', UserWarning)
104-
105-
tag = GhApi(gh_host='https://api.github.com', authenticate=False).repos.get_latest_release(org_or_usr, repo).tag_name
106-
107-
url = f"https://github.com/{org_or_usr}/{repo}/archive/{tag}.tar.gz"
89+
with warnings.catch_warnings():
90+
warnings.simplefilter('ignore', UserWarning)
91+
tag = GhApi(gh_host='https://api.github.com', authenticate=False).repos.get_latest_release('fastai', 'nbdev-template').tag_name
92+
url = f"https://github.com/fastai/nbdev-template/archive/{tag}.tar.gz"
10893
extract_tgz(url)
109-
tmpl_path = path/f'{repo}-{tag}'
94+
tmpl_path = path/f'nbdev-template-{tag}'
11095

11196
cfg.nbs_path.mkdir(exist_ok=True)
11297
nbexists = bool(first(cfg.nbs_path.glob('*.ipynb')))

0 commit comments

Comments
 (0)