Skip to content

Instantly share code, notes, and snippets.

@aliboy08
Last active July 2, 2024 08:32
Show Gist options
  • Save aliboy08/3f3ce35581d236059ce108cfce490747 to your computer and use it in GitHub Desktop.
Save aliboy08/3f3ce35581d236059ce108cfce490747 to your computer and use it in GitHub Desktop.
WPEngine dist folder upload script
@echo off
setlocal
set install_name=bigdaddylocal
set theme_folder=fivebyfive
REM Set variables
set remote_base_dir=/sites/%install_name%/wp-content/themes/%theme_folder%/
set ssh_host=%install_name%@%install_name%.ssh.wpengine.net
echo Preparing dist files...
if not exist "dist_temp" (
mkdir dist_temp"
)
echo Y | xcopy "dist\*" "dist_temp\" /E /H /C /I /Q /Y
echo Uploading dist files...
scp -r dist_temp %ssh_host%:%remote_base_dir%
echo Moving dist files...
ssh %ssh_host% "cd %remote_base_dir% && mkdir -p dist && rm -rf dist/* && rsync -rvP dist_temp/ dist/ && rm -rf dist_temp && cd ~ && wp cache flush"
@REM Cleanup
if exist "dist_temp" (
rd /s /q "dist_temp"
)
endlocal
@REM pause
exit /b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment