Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document behavior of generating destination path when copying #1498

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,21 +77,23 @@ To generate a project from the template:

- Or in Python code, programmatically:

```python
from copier import run_copy
```python
from copier import run_copy

# Create a project from a local path
run_copy("path/to/project/template", "path/to/destination")
# Create a project from a local path
run_copy("path/to/project/template", "path/to/destination")

# Or from a Git URL.
run_copy("https://github.com/copier-org/copier.git", "path/to/destination")
# Or from a Git URL.
run_copy("https://github.com/copier-org/copier.git", "path/to/destination")

# You can also use "gh:" as a shortcut of "https://github.com/"
run_copy("gh:copier-org/copier.git", "path/to/destination")
# You can also use "gh:" as a shortcut of "https://github.com/"
run_copy("gh:copier-org/copier.git", "path/to/destination")

# Or "gl:" as a shortcut of "https://gitlab.com/"
run_copy("gl:copier-org/copier.git", "path/to/destination")
```
# Or "gl:" as a shortcut of "https://gitlab.com/"
run_copy("gl:copier-org/copier.git", "path/to/destination")
```
Comment on lines -80 to +94
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think these indentation changes are necessary.


If `path/to/destination` doesn't exist, Copier will create the directory.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can just leave it documented in ˋgenerating.mdˋ. This way, the README is shorter. It's not something with so much importance so as to live in the README IMHO.


## Basic concepts

Expand Down
4 changes: 4 additions & 0 deletions docs/generating.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ Or within Python code:
copier.run_copy("path/to/project/template", "path/to/destination")
```

If `path/to/destination` doesn't exist, Copier will create the directory and populate it
with the generated files. If `path/to/destination` exists, it must be writable (not
read-only).

The "template" parameter can be a local path, an URL, or a shortcut URL:

- GitHub: `gh:namespace/project`
Expand Down
Loading