add bash completion to ncc

Signed-off-by: nachoparker <nacho@ownyourbits.com>
This commit is contained in:
nachoparker 2021-09-29 20:06:07 -06:00
parent 2be666b1f5
commit c037c11dfc
5 changed files with 26 additions and 2 deletions

View File

@ -234,6 +234,9 @@ fi
rm -rf /var/www/nextcloud/apps/previewgenerator
ln -snf "${NCPREV}" /var/www/nextcloud/apps/previewgenerator
# refresh completions
ncc _completion -g --shell-type bash -p ncc | sed 's|/var/www/nextcloud/occ|ncc|g' > /usr/share/bash-completion/completions/ncp
# done
####################
mkdir -p "$DATADIR"/ncp-update-backups

View File

@ -181,6 +181,12 @@ EOF
ncc config:system:set overwrite.cli.url --value="https://nextcloudpi/"
ncc config:system:set trusted_domains "${TRUSTED_DOMAINS[nc_domain]}" --value="nextcloudpi"
# bash completion for ncc
apt_install bash-completion
ncc _completion -g --shell-type bash -p ncc | sed 's|/var/www/nextcloud/occ|ncc|g' > /usr/share/bash-completion/completions/ncp
echo ". /etc/bash_completion" >> /etc/bash.bashrc
echo ". /usr/share/bash-completion/completions/ncp" >> /etc/bash.bashrc
# TODO temporary workaround for https://github.com/nextcloud/server/pull/13358
ncc -n db:convert-filecache-bigint
ncc db:add-missing-indices

View File

@ -1,5 +1,7 @@
[v1.39.16](https://github.com/nextcloud/nextcloudpi/commit/e6ebc3d) (2021-09-27) nc-https: proto logic was inverted fix
[v1.39.17](https://github.com/nextcloud/nextcloudpi/commit/520f062) (2021-09-29) add bash completion to ncc
[v1.39.16](https://github.com/nextcloud/nextcloudpi/commit/2be666b) (2021-09-27) nc-https: proto logic was inverted fix
[v1.39.15](https://github.com/nextcloud/nextcloudpi/commit/b067844) (2021-09-27) add get_ip function

2
ncp.sh
View File

@ -34,7 +34,7 @@ install()
# add the ncc shortcut
cat > /usr/local/bin/ncc <<'EOF'
#!/bin/bash
sudo -u www-data php /var/www/nextcloud/occ "$@"
sudo -E -u www-data php /var/www/nextcloud/occ "$@"
EOF
chmod +x /usr/local/bin/ncc

View File

@ -36,6 +36,19 @@ EOF
# fix issue with reverse proxy infinite redirections
run_app nc-httpsonly
# bash completion for `ncc`
if ! [[ -f /usr/share/bash-completion/completions/ncp ]]; then
apt_install bash-completion
ncc _completion -g --shell-type bash -p ncc | sed 's|/var/www/nextcloud/occ|ncc|g' > /usr/share/bash-completion/completions/ncp
echo ". /etc/bash_completion" >> /etc/bash.bashrc
echo ". /usr/share/bash-completion/completions/ncp" >> /etc/bash.bashrc
cat > /usr/local/bin/ncc <<'EOF'
#!/bin/bash
sudo -E -u www-data php /var/www/nextcloud/occ "$@"
EOF
chmod +x /usr/local/bin/ncc
fi
# docker images only
[[ -f /.docker-image ]] && {
: