From fbdb622fd0f453a696f089e1393370c0b2288d5d Mon Sep 17 00:00:00 2001 From: Ian Johnson Date: Fri, 5 Jul 2019 20:14:35 -0500 Subject: [PATCH] snap/hooks/install: create profiles dir before copy Previously the snap was uninstallable because the directory didn't exist. Signed-off-by: Ian Johnson --- snap/hooks/install | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/snap/hooks/install b/snap/hooks/install index 1bff58b..2c2cce7 100755 --- a/snap/hooks/install +++ b/snap/hooks/install @@ -21,4 +21,7 @@ if [ ! -f "$SNAP_DATA/config/edgex-device-grove/res/configuration.toml" ]; then "$SNAP_DATA/config/edgex-device-grove/res/configuration.toml" fi -cp "$SNAP/config/edgex-device-grove/res/profiles/Grove_Device.yaml" "$SNAP_DATA/config/edgex-device-grove/res/profiles/Grove_Device.yaml" +mkdir -p $SNAP_DATA/config/edgex-device-grove/res/profiles +if [ ! -f "$SNAP_DATA/config/edgex-device-grove/res/profiles/Grove_Device.yaml" ]; then + cp "$SNAP/config/edgex-device-grove/res/profiles/Grove_Device.yaml" "$SNAP_DATA/config/edgex-device-grove/res/profiles/Grove_Device.yaml" +fi