-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake-snap.bash
executable file
·35 lines (27 loc) · 946 Bytes
/
make-snap.bash
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
# A naive Bash script for making snap
# It is assumed that you are using bash shell and you have:
# - Go compiler installed, and
# - $GOPATH set properly, and
# - the Go packagaes 'github.com/go-gl/{gl,glfw,mathgl}' and 'golang.org/x' installed
# - sapcraft installed
# - rsync installed
while getopts ":u" opt; do
echo 'Updating Go packages ...';
go get -u -v # update Go packages;
done;
./make-mki3game.bash
echo 'Preparing for snap ...'
rm -rf build-snap # start with fresh directory
mkdir build-snap # do everything in the 'build' directory
pushd build-snap/ # Go to the build directory.
echo 'copy the relevant files for snap ...'
cp ../mki3dgame-snap-wrapper.bash .
rsync -av ../snap .
rsync -av ../assets .
cp ../mki3dgame .
echo 'Building snap ...'
snapcraft --use-lxd
# mv mki3dgame-snap_*.snap ../
popd # return to the directory
echo 'Your snap should be in: ./build-snap/mki3dgame-snap_[...].snap'