Skip to content

Commit 1a9bb69

Browse files
committed
👌 Simplify plugin_name default value
We were using `{{ _copier_conf.dst_path | basename }}` for the default of `plugin_name` variable. However, this has several issues: 1. When the user tries to copy the template in the current directory (`.`), the `.` also shows up as the default. 1. The `dst_path` may be a temporary directory when updating projects. This might be an issue down the line. Turns out `copier` defines a global variable `_folder_name` that gives the name of the (generated) project root directory. This means the default can be simplified, and we don't face the issues described above.
1 parent d6f2ad2 commit 1a9bb69

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

copier.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
plugin_name:
22
type: str
33
help: 'What is the name of your plugin package?'
4-
default: '{{ _copier_conf.dst_path | basename }}'
5-
4+
default: '{{_folder_name }}'
65
description:
76
type: str
87
help: 'Describe what your plugin package is for.'

0 commit comments

Comments
 (0)