-
-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathsetup-util-snap
executable file
·69 lines (58 loc) · 1.89 KB
/
setup-util-snap
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/env bash
# https://wiki.manjaro.org/index.php/Snap
# https://packages.ubuntu.com/bionic/gnome/gnome-software-plugin-snap
# https://snapcraft.io/docs/installing-snap-on-opensuse
# https://software.opensuse.org/download/package?package=snapd&project=system:snappy
# https://en.opensuse.org/Snap <-- this is the correct info
# https://software.opensuse.org/download/package?package=snapd&project=system:snappy <-- this is not correct
# https://packages.debian.org/sid/amd64/snapd/filelist
# /usr/bin/snap
# /usr/bin/snapctl
# /usr/bin/ubuntu-core-launcher
function setup_util_snap() (
source "$DOROTHY/sources/bash.bash"
# checks
if ! is-linux; then
echo-style --notice="[$0] is only intended to be run on Linux systems, skipping." >/dev/stderr
return 0
fi
# setup
local options=(
--name='snap'
--cli='snap'
"$@"
APT='snapd' # UBUNTU
AUR='snapd' # ARCH
RPM='snapd' # FEDORA
ZYPPER_REPO_ALIAS='snappy'
ZYPPER_REPO="https://download.opensuse.org/repositories/system:snappy/$(get-opensuse-release 2>/dev/null || :)/"
ZYPPER='snapd' # SUSE
)
setup-util "${options[@]}"
# if installed, configure
if is-snap; then
# log start
echo-style --h2='Configure snap'
# ensure snap is discoverable to the system
if test ! -d /snap; then
sudo-helper -- ln -s /var/lib/snapd/snap /snap
fi
# ensure snap service is running
if service-helper --supported; then
service-helper --enable --start -- snapd.socket snapd.apparmor
fi
# install snap support for gnome-software (if it exists)
if __command_exists -- gnome-software; then
# PAMAC='gnome-software-snap' \
# Error: target not found: gnome-software-snap
setup-util --optional --name='Snap via Gnome Software' "$@" \
APT='gnome-software-plugin-snap' # UBUNTU
fi
# log success
echo-style --g2='Configure snap'
fi
)
# fire if invoked standalone
if test "$0" = "${BASH_SOURCE[0]}"; then
setup_util_snap "$@"
fi