Skip to content
This repository has been archived by the owner on May 15, 2024. It is now read-only.

Commit

Permalink
Erico's suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
sneridagh committed Apr 5, 2024
1 parent 5af074b commit 5e72382
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 14 deletions.
3 changes: 2 additions & 1 deletion volto_addon/cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"github_organization": "GitHub Username or Organization",
"npm_package_name": "Package name on NPM",
"author": "Author",
"email": "Author E-mail"
"email": "Author E-mail",
"noaddon": "Do not add the default addon"
},
"_copy_without_render": [],
"_extensions": []
Expand Down
9 changes: 5 additions & 4 deletions volto_addon/hooks/post_gen_project.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Post generation hook."""

import os
import pathlib
import shutil
import subprocess
import sys
Expand Down Expand Up @@ -45,9 +45,10 @@ def run_cmd(command: str, shell: bool, cwd: str) -> bool:


def remove(filepath):
if os.path.isfile(filepath):
os.remove(filepath)
elif os.path.isdir(filepath):
filepath = pathlib.Path(filepath)
if filepath.is_file():
filepath.unlink()
elif filepath.is_dir():
shutil.rmtree(filepath)


Expand Down
5 changes: 1 addition & 4 deletions volto_addon/{{ cookiecutter.addon_name }}/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,8 @@
},
"dependencies": {
"@plone/volto": "workspace:*",
{% if not cookiecutter.noaddon -%}
"@plone/registry": "workspace:*",
"@plone/registry": "workspace:*"{%- if not cookiecutter.noaddon -%},
"{{ cookiecutter.npm_package_name }}": "workspace:*"
{%- else -%}
"@plone/registry": "workspace:*"
{%- endif %}
},
"devDependencies": {
Expand Down
6 changes: 1 addition & 5 deletions volto_addon/{{ cookiecutter.addon_name }}/volto.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
{% if not cookiecutter.noaddon -%}
const addons = ['{{ cookiecutter.npm_package_name }}'];
{% else -%}
const addons = [];
{% endif -%}
const addons = [{% if not cookiecutter.noaddon -%}'{{ cookiecutter.npm_package_name }}'{% endif -%}];
const theme = '';

module.exports = {
Expand Down

0 comments on commit 5e72382

Please sign in to comment.