Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Commit

Permalink
Added path usage in README
Browse files Browse the repository at this point in the history
  • Loading branch information
Vianpyro committed Feb 14, 2021
1 parent dee0709 commit 7c004ee
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ my_datapack_title = 'My_Datapack'

myDatapack = Datapack(
title = my_datapack_title,
path='~\\home\\Vianpyro\\.minecraft\\saves\\world_42\\datapacks',
author = 'Vianpyro',
pack_meta = {
'minecraft_version': '1.16.4',
Expand Down
7 changes: 6 additions & 1 deletion wmcpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ def __init__(self, title, path=None, author="Vianpyro's datapack generator", pac
self.title = title.lower()

# Checking if the path given is valid.
self.path = '' if path is None else path + os.path.sep
if path is None:
self.path = ''
elif path[-1] == os.path.sep:
self.path = path
else:
self.path = path + os.path.sep

# Is this datapack new?
self.exists = os.path.exists(self.path + self.title)
Expand Down

0 comments on commit 7c004ee

Please sign in to comment.