-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added support for optional
web
directory for custom javascript
- when `web` is included, `WEB_DIRECTORY` is also set to `web`
- Loading branch information
1 parent
f44084b
commit 4a38aa9
Showing
5 changed files
with
27 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
#!/usr/bin/env python | ||
import pathlib | ||
from pathlib import Path as Pth | ||
import shutil | ||
|
||
|
||
if __name__ == '__main__': | ||
if 'Not open source' == '{{ cookiecutter.open_source_license }}': | ||
pathlib.Path('LICENSE').unlink() | ||
if __name__ == "__main__": | ||
if "{{cookiecutter.open_source_license}}" == "Not open source": | ||
Pth("LICENSE").unlink() | ||
|
||
if "{{cookiecutter.__include_web}}" == "False": | ||
shutil.rmtree("src/{{cookiecutter.project_slug}}/web") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
include LICENSE | ||
include README.md | ||
|
||
recursive-include tests * | ||
recursive-exclude * __pycache__ | ||
recursive-exclude * *.py[co] | ||
|
||
recursive-include docs *.rst conf.py Makefile make.bat *.jpg *.png *.gif | ||
|
||
{% if cookiecutter.__include_web -%} | ||
|
||
graft src/{{cookiecutter.project_slug}}/web | ||
|
||
{%- endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
{{cookiecutter.project_name}}/src/{{cookiecutter.project_slug}}/web/js/example.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { app } from "../../../scripts/app.js"; | ||
|
||
console.log(app) |