25 lines
502 B
Bash
25 lines
502 B
Bash
#!/bin/bash
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
function check_zola_is_present() {
|
|
if zola --version >/dev/null 2>&1; then
|
|
echo "true"
|
|
else
|
|
echo "false"
|
|
fi
|
|
}
|
|
|
|
# function install_zola() {}
|
|
|
|
# Build Zola project from git repo
|
|
# Requires $git_url, $path_url and $final_path to be set
|
|
function zola_build() {
|
|
tmp_dir=/tmp/zola_build-$(date "+%Y%m%d")
|
|
mkdir $tmp_dir && cd $tmp_dir
|
|
git clone $git_url source
|
|
cd source/
|
|
zola build --base-url $path_url --output-dir $final_path
|
|
rm -r $tmp_dir
|
|
}
|