Previously, when directory was set to anything other than /, say, directory = example/, GitHub's API returns the filename and path. Instead of duplicating the path, we need a function that returns the path and filename received from GitHub and concatenates it with the baseUrl to prevent the previous behaviour of saving a string like https://raw.githubusercontent.com[…]example/example/file.jpg.
Previously, when directory was set to anything other than
/
, say, directory =example/
, GitHub's API returns the filename and path. Instead of duplicating the path, we need a function that returns the path and filename received from GitHub and concatenates it with the baseUrl to prevent the previous behaviour of saving a string likehttps://raw.githubusercontent.com[…]example/example/file.jpg
.