Commit 527cc733 authored by Thomasa Balthazar's avatar Thomasa Balthazar

Add condition check before installing apps lists

Looks like `sudo yunohost app fetchlist -n name -u https://...` now
returns an error when there's already an apps list named `name`.

This cause the install script to fail when trying to add a list named
`labriqueinternet` on a Cube that already has one.

I'm not sure if this behavior is new to Yunohost 2.6, but I started
noticing the problem since 2.6.

This quick fix attempts to determine if a list named `name` already
exists by grepping on `name:` in the output of `listlists`. This is not
robust since it does rely on the output format of the command which
might change.
parent 08cd4cc1
......@@ -72,10 +72,22 @@ renew_cert() {
cd $install_dir
}
install_neutrinet_apps_list() {
if ! sudo yunohost app listlists | grep -q "neutrinet:"; then
sudo yunohost app fetchlist -n neutrinet -u https://neutrinet.be/apps.json
fi
}
install_labriqueinternet_apps_list() {
if ! sudo yunohost app listlists | grep -q "labriqueinternet :"; then
sudo yunohost app fetchlist -n labriqueinternet -u https://labriqueinter.net/apps/labriqueinternet.json
fi
}
sudo yunohost app setting neutrinet version -v "0.2"
sudo yunohost app fetchlist -n neutrinet -u https://neutrinet.be/apps.json
sudo yunohost app fetchlist -n labriqueinternet -u https://labriqueinter.net/apps/labriqueinternet.json
install_neutrinet_apps_list
install_labriqueinternet_apps_list
get_out_of_testing
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment