Skip to content

[Fix provided]: Add support for user's home directory based paths. #47

Description

@nivintw

Currently, when setting "custom_template_header_path" and "custom_template_body_path" only absolute paths are supported because of the current state of get_template_part in FileHeader.py.

I have found an OS agnostic method of handling paths based on home directories, and it is tested and working on OSX, and should work on the other major OSes.

Simply change

_ = os.path.join(custom_template_path, tmpl_name)

to

_ = os.path.expanduser(os.path.join(custom_template_path, tmpl_name))

If the given path does not contain a home directory relative to that system then the function will return the original path unmodified.

If you'd prefer, I can submit a pull request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions