From 5de24a256ed9d8e9afe03fa71f0996fef59cdcaf Mon Sep 17 00:00:00 2001 From: Jordan Christiansen Date: Wed, 4 Oct 2017 16:18:41 +0000 Subject: [PATCH] Make the snap build use the latest binary --- bot/bot.go | 1 + bot/{handler_test.go => handlers_test.go} | 0 packages/build_snap.sh | 1 + packages/snap/snapcraft.yaml.template | 4 +++- 4 files changed, 5 insertions(+), 1 deletion(-) rename bot/{handler_test.go => handlers_test.go} (100%) diff --git a/bot/bot.go b/bot/bot.go index af63c4d..69b8565 100644 --- a/bot/bot.go +++ b/bot/bot.go @@ -64,6 +64,7 @@ func (b *BotServer) botListener(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusBadRequest) } + // TODO: Make this more safe when there are missing fields. if message, ok := jsonBody["message"].(map[string]interface{}); ok { messageText := message["text"].(string) if url := xurls.Strict.FindString(messageText); url != "" { diff --git a/bot/handler_test.go b/bot/handlers_test.go similarity index 100% rename from bot/handler_test.go rename to bot/handlers_test.go diff --git a/packages/build_snap.sh b/packages/build_snap.sh index f81097b..d9e24cd 100755 --- a/packages/build_snap.sh +++ b/packages/build_snap.sh @@ -15,4 +15,5 @@ else sed -i "s/{{grade}}/stable/" snap/snapcraft.yaml fi +snapcraft clean snapcraft diff --git a/packages/snap/snapcraft.yaml.template b/packages/snap/snapcraft.yaml.template index 0108879..eeb6a3f 100644 --- a/packages/snap/snapcraft.yaml.template +++ b/packages/snap/snapcraft.yaml.template @@ -15,14 +15,16 @@ parts: plugin: dump stage-packages: [ youtube-dl ] stage: + - squirrelbot - bin/* - usr/* prime: + - squirrelbot - bin/* - usr/* apps: squirrelbot: - command: env SQUIRRELBOT_CONFIG_FILE="$SNAP_COMMON/config.yaml" "$SNAP/bin/squirrelbot" + command: env SQUIRRELBOT_CONFIG_FILE="$SNAP_COMMON/config.yaml" "$SNAP/squirrelbot" daemon: simple plugs: [ home, network, network-bind ]