LicenseGenerator-iOS
LicenseGenerator-iOS copied to clipboard
Wrong title when Licence file is not in root folder
trafficstars
When the licence file of the pod is in a directory that is not named after the pod (e.g. not in the root, instead in a subfolder called "foo") you get the wrong title (in this case: "foo").
The actual line of code can be found in credits.py:
title = path.split("/")[-2]
This just takes the parent of the licence file as title.
Example pod where it fails:
- App Center
Expected Behavior: Title should be "AppCenter"
Actual Behavior: Title is "iOS" (because the parent folder of Licence file is "iOS")
A quick solution can be:
title = re.sub('^.*\/Pods\/', '', path).split("/")[0]
# use the directory name of the installed pod (subfolders doesn't matter)
But with this solution only LICENSE files for Pods will work...