Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/nextcloudpi.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornachoparker <nacho@ownyourbits.com>2021-09-30 05:06:07 +0300
committernachoparker <nacho@ownyourbits.com>2021-09-30 05:07:56 +0300
commitc037c11dfc6e785893907fd354031d7f4c517213 (patch)
treec6148bdbdd6e59372c58a79e26474eb5e986339d
parent2be666b1f5f43492929bc00872283f6e7ece2443 (diff)
add bash completion to nccv1.39.17
Signed-off-by: nachoparker <nacho@ownyourbits.com>
-rwxr-xr-xbin/ncp-update-nc3
-rw-r--r--bin/ncp/CONFIG/nc-init.sh6
-rw-r--r--changelog.md4
-rw-r--r--ncp.sh2
-rw-r--r--updates/1.40.0.sh13
5 files changed, 26 insertions, 2 deletions
diff --git a/bin/ncp-update-nc b/bin/ncp-update-nc
index 2bec0aa5..50f6379b 100755
--- a/bin/ncp-update-nc
+++ b/bin/ncp-update-nc
@@ -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
diff --git a/bin/ncp/CONFIG/nc-init.sh b/bin/ncp/CONFIG/nc-init.sh
index 9acfdbb3..0df7c3c8 100644
--- a/bin/ncp/CONFIG/nc-init.sh
+++ b/bin/ncp/CONFIG/nc-init.sh
@@ -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
diff --git a/changelog.md b/changelog.md
index 7e60de1f..ce52e041 100644
--- a/changelog.md
+++ b/changelog.md
@@ -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
diff --git a/ncp.sh b/ncp.sh
index 8fff524d..26bc0fe4 100644
--- a/ncp.sh
+++ b/ncp.sh
@@ -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
diff --git a/updates/1.40.0.sh b/updates/1.40.0.sh
index 139934ed..2741ab7b 100644
--- a/updates/1.40.0.sh
+++ b/updates/1.40.0.sh
@@ -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 ]] && {
: