diff --git a/bin/sandbox.sh b/bin/sandbox.sh index 32a956a..181349b 100644 --- a/bin/sandbox.sh +++ b/bin/sandbox.sh @@ -20,13 +20,15 @@ function wputools__sandbox(){ local _CURRENT_DIR_SANDBOX=$(pwd); # Download WordPress - _WPCLICOMMAND core download; - if [[ "${_MODE}" == 'sqlite' ]];then + # Specific WordPress version + _WPCLICOMMAND core download --version=6.4.3; # Download and Install SQLite integration git clone https://github.com/aaemnnosttv/wp-sqlite-db.git; mv wp-sqlite-db/src/db.php wp-content/db.php; rm -rf wp-sqlite-db; + else + _WPCLICOMMAND core download; fi; # Install site diff --git a/inc/autocomplete.sh b/inc/autocomplete.sh index e745d25..c1013fb 100644 --- a/inc/autocomplete.sh +++ b/inc/autocomplete.sh @@ -13,6 +13,7 @@ _wputools_complete() { local _base_wp_dir=$(awk -F '/wp-content' '{print $1}' <<< "${PWD}"); local _base_wp_dir_content="${_base_wp_dir}/wp-content/"; local _base_wp_dir_plugins="${_base_wp_dir_content}plugins"; + local _list_backup_dir=( "../backups/" "../" "../local-backups/" ); COMPREPLY=() cur=${COMP_WORDS[COMP_CWORD]} @@ -32,9 +33,13 @@ _wputools_complete() { COMPREPLY=( $(compgen -W "current_theme mu-plugins plugins themes uploads" -- $cur) ) ;; "dbimport") - COMPREPLY=( $( compgen -o plusdirs -f -X '!*.sql' -- $cur ) ) - COMPREPLY+=( $( compgen -o plusdirs -f -X '!*.tar.gz' -- $cur ) ) - COMPREPLY+=( $( compgen -o plusdirs -f -X '!*.sql.gz' -- $cur ) ) + COMPREPLY=( $(compgen -W "latest" -- $cur) ) + for dir in "${_list_backup_dir[@]}"; do + if [[ -d "${_base_wp_dir}/$dir" ]]; then + _reply=$(ls -1 "${_base_wp_dir}/$dir" | awk -F'/' '{print "'$dir'"$NF}' | grep '\.tar\.gz$'); + COMPREPLY+=( $(compgen -W "${_reply}" -- $cur) ); + fi + done ;; "muplugin") COMPREPLY=( $(compgen -W "$(cat "${_WPUTOOLS_MUPLUGIN_LIST}")" -- $cur) ) diff --git a/wputools.sh b/wputools.sh index 2f0f089..5397632 100644 --- a/wputools.sh +++ b/wputools.sh @@ -2,7 +2,7 @@ WPUTools(){ -local _WPUTOOLS_VERSION='0.94.0'; +local _WPUTOOLS_VERSION='0.94.1'; local _PHP_VERSIONS=(7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4 8.5 9.0) local _PHP_VERSIONS_OBSOLETES=(7.0 7.1 7.2 7.3 7.4) local _PHP_VERSIONS_ADVANCED=(8.2 8.3 8.4 8.5 9.0)