Skip to content

Commit c292e70

Browse files
committed
Use license directory gotten from pacman
1 parent 6564e38 commit c292e70

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

platform/windows/create-license-directory.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,13 @@ get_dependencies ( ) {
3232
}
3333

3434
copy_license_directory ( ) {
35-
if [ -d "/mingw64/share/licenses/${1}" ]; then
35+
ORIGINAL_DIRECTORY="$(pacman -Ql ${1}| grep '/licenses/*/$'|cut -f2 -d ' ')"
36+
ORIGINAL_DIRECTORY="${ORIGINAL_DIRECTORY::-1}"
37+
if [ -n "${ORIGINAL_DIRECTORY}" ] && [ -d "${ORIGINAL_DIRECTORY}" ]; then
3638
if [ ! -d "${LICENSE_DIRECTORY}/${1}" ]; then
3739
echo "Adding license for ${1} to ${LICENSE_DIRECTORY}"
3840
fi
39-
cp -rf "/mingw64/share/licenses//${1}" "${LICENSE_DIRECTORY}/"
41+
cp -rf "${ORIGINAL_DIRECTORY}" "${LICENSE_DIRECTORY}/"
4042
for dependency in $(get_dependencies "${1}"); do
4143
if [ "${dependency}" == "None" ]; then
4244
continue

0 commit comments

Comments
 (0)