#!/bin/bash

# make workspace
mkdir -p snap_ws/src
cd snap_ws && catkin_init_workspace
cd src

# add all the necessary things to it
git clone -b melodic-devel https://github.com/SteveMacenski/slam_toolbox.git
cd ../

# move snap and hooks to right place
mkdir snap
cp -r src/slam_toolbox/snap/snapcraft.yaml snap

# build the snap
export SNAPCRAFT_BUILD_ENVIRONMENT_MEMORY=4g
snapcraft

# go back to root
cd ../
