Skip to content

Commit

Permalink
v 0.94.1
Browse files Browse the repository at this point in the history
- DB Import : autocomplete with backup directories.
- Sandbox : use latest WP version compatible with SQLite.
  • Loading branch information
Darklg committed Jun 1, 2024
1 parent e41b466 commit 85e1313
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
6 changes: 4 additions & 2 deletions bin/sandbox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 8 additions & 3 deletions inc/autocomplete.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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]}
Expand All @@ -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) )
Expand Down
2 changes: 1 addition & 1 deletion wputools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 85e1313

Please sign in to comment.