Skip to content

Commit

Permalink
only copy files in hook if directory exists (Fixes: fwupd#2619)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mario Limonciello authored and superm1 committed Feb 8, 2021
1 parent 3a30c12 commit 5bbb0b7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions snap/hooks/install
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
#!/bin/sh -e

install_if_missing() {
directory=$(dirname ${2}/${1})
if [ "$2" != "/" ]; then
mkdir -p $(dirname ${2}/${1})
mkdir -p $directory
fi
if [ -d $directory ]; then
install -m 644 -C ${SNAP}/${1} ${2}/${1}
fi
install -m 644 -C ${SNAP}/${1} ${2}/${1}
}

#install policykit rules and actions
Expand Down

0 comments on commit 5bbb0b7

Please sign in to comment.