1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/searxng_ynh.git synced 2024-09-03 20:26:00 +02:00

Refractor

This commit is contained in:
Sylvain 2024-07-21 20:13:56 +02:00
parent 19a7e6c733
commit 4141d4355b

View file

@ -15,26 +15,27 @@ myynh_source_searxng () {
commit_sha=$(ynh_read_manifest --manifest_key="resources.sources.main.url" | xargs basename --suffix=".tar.gz") commit_sha=$(ynh_read_manifest --manifest_key="resources.sources.main.url" | xargs basename --suffix=".tar.gz")
# Download source # Download source
ynh_exec_fully_quiet git clone -n "$repo_fullpath" "$install_dir/searxng-src" sudo -i -u $app bash << EOF
git config --global --add safe.directory "$install_dir/searxng-src" git clone -n "$repo_fullpath" "$install_dir/searxng-src"
pushd "$install_dir/searxng-src" pushd "$install_dir/searxng-src"
ynh_exec_fully_quiet git checkout "$commit_sha" ynh_exec_fully_quiet git checkout "$commit_sha"
popd popd
EOF
} }
myynh_install_searxng () { myynh_install_searxng () {
# Create the virtual environment # Create the virtual environment
sudo -i -u $app bash << EOF sudo -H -u $app -i bash << EOF
python3 -m venv "$install_dir/searxng-pyenv" python3 -m venv "$install_dir/searxng-pyenv"
echo ". $install_dir/searxng-pyenv/bin/activate" >> "$install_dir/.profile" echo ". $install_dir/searxng-pyenv/bin/activate" >> "$install_dir/.profile"
EOF EOF
# Check if virtualenv was sourced from the login # Check if virtualenv was sourced from the login
sudo -i -u $app bash << EOF sudo -H -u $app -i bash << EOF
command -v python && python --version command -v python && python --version
EOF EOF
sudo -i -u $app bash << EOF sudo -H -u $app -i bash << EOF
pip install --upgrade pip pip install --upgrade pip
pip install --upgrade setuptools pip install --upgrade setuptools
pip install --upgrade wheel pip install --upgrade wheel
@ -60,7 +61,9 @@ myynh_upgrade_venv_directory () {
-exec bash -c 'rm --force --recursive "$1"' _ {} \; -exec bash -c 'rm --force --recursive "$1"' _ {} \;
# Upgrade the virtual environment directory # Upgrade the virtual environment directory
ynh_exec_as $app $py_app_version -m venv --upgrade "$install_dir" sudo -H -u $app -i bash << EOF
python3 -m venv --upgrade "$install_dir"
EOF
} }
# Set permissions # Set permissions