LicenseGenerator-iOS icon indicating copy to clipboard operation
LicenseGenerator-iOS copied to clipboard

Wrong title when Licence file is not in root folder

Open orschaef opened this issue 6 years ago • 1 comments
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")

orschaef avatar Apr 24 '19 15:04 orschaef

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...

VirtualFox0 avatar Apr 24 '19 15:04 VirtualFox0