Skip to content

Commit eaae648

Browse files
author
Jackson
committed
Use full length project names, and update shortened if exists
1 parent 56b5de6 commit eaae648

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/classes/assets.py

+10-2
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,20 @@ def get_assets_path(file_path=None, create_paths=True):
4040
# Generate asset folder name, max 30 chars of filename + "_assets"
4141
file_path = file_path
4242
asset_filename = os.path.splitext(os.path.basename(file_path))[0]
43-
asset_folder_name = asset_filename[:30] + "_assets"
43+
asset_folder_name = asset_filename + "_assets"
44+
asset_folder_name_30_char = asset_filename[:30] + "_assets"
4445
asset_path = os.path.join(os.path.dirname(file_path), asset_folder_name)
46+
asset_path_30_char = os.path.join(os.path.dirname(file_path), asset_folder_name_30_char)
47+
48+
4549

4650
# Create asset folder, if necessary
4751
if create_paths:
48-
if not os.path.exists(asset_path):
52+
53+
if os.path.exists(asset_path_30_char):
54+
os.rename(asset_path_30_char, asset_path)
55+
log.info("Updating 30 character path to full length {}".format(asset_path))
56+
elif not os.path.exists(asset_path):
4957
os.mkdir(asset_path)
5058
log.info("Asset dir created as {}".format(asset_path))
5159
else:

0 commit comments

Comments
 (0)