1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/agendav_ynh.git synced 2024-09-03 20:36:12 +02:00
agendav_ynh/scripts/_common.sh
Salamandar b18498adc4
Manifestv2 port (#71)
* Testing (#70)

* Fix upgrade

* Bump package version

* Auto-update README

* Upgrade to version 2.6.0 (#67)

* Upgrade to v2.6.0

* Auto-update README

Co-authored-by: yunohost-bot <yunohost-bot@users.noreply.github.com>
Co-authored-by: yunohost-bot <yunohost@yunohost.org>

* Upgrade auto-updater (#69)

* Auto-update README

* [autopatch] Upgrade auto-updater

* Auto-update README

---------

Co-authored-by: tituspijean <titus@pijean.ovh>

* Update _common.sh

* Update _common.sh

* Update manifest.json

* Auto-update README

---------

Co-authored-by: tituspijean <tituspijean@outlook.com>
Co-authored-by: yunohost-bot <yunohost@yunohost.org>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: yunohost-bot <yunohost-bot@users.noreply.github.com>
Co-authored-by: tituspijean <titus@pijean.ovh>

* Manifestv2 port

* Add a final chmod on the install_dir

* Update manifest.toml

* cleaning

---------

Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com>
Co-authored-by: tituspijean <tituspijean@outlook.com>
Co-authored-by: yunohost-bot <yunohost@yunohost.org>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: yunohost-bot <yunohost-bot@users.noreply.github.com>
Co-authored-by: tituspijean <titus@pijean.ovh>
2023-09-27 12:41:57 +02:00

36 lines
1.2 KiB
Bash

#!/bin/bash
#=================================================
# COMMON VARIABLES
#=================================================
#=================================================
# PERSONAL HELPERS
#=================================================
_ynh_agendav_find_caldav_app() {
mapfile -t all_apps < <(yunohost app list --output-as json --quiet | jq -r ".apps[].id")
mapfile -t installed_baikal < <(printf -- '%s\n' "${all_apps[@]}" | grep baikal)
mapfile -t installed_radicale < <(printf -- '%s\n' "${all_apps[@]}" | grep radicale)
if (( "${#installed_baikal[@]}" > 0 )); then
caldav_app="${installed_baikal[0]}"
caldav_baseurl="/cal.php/"
elif (( "${#installed_radicale[@]}" > 0 )); then
caldav_app="${installed_baikal[0]}"
caldav_baseurl=/
else
ynh_die --message="Please install Baïkal or Radicale before AgenDAV."
fi
echo -e "$caldav_app $caldav_baseurl"
}
#=================================================
# EXPERIMENTAL HELPERS
#=================================================
#=================================================
# FUTURE OFFICIAL HELPERS
#=================================================