From d23b6bd3830d4ad562853438b02e146035df0f9e Mon Sep 17 00:00:00 2001 From: Immanuel Raj Date: Wed, 29 Apr 2026 17:53:07 +0530 Subject: [PATCH 1/2] feat: persist llms.txt across deployments via shared symlink Exclude llms.txt from rsync so it is never deleted by --delete, and add a task that symlinks shared/llms.txt into each release when the file exists on the server. Sites without the file are unaffected. --- deploy.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/deploy.php b/deploy.php index ae9bd91..5628567 100644 --- a/deploy.php +++ b/deploy.php @@ -51,6 +51,7 @@ 'package-lock.json', 'package.json', 'phpcs.xml', + 'llms.txt', ], 'exclude-file' => true, 'include' => [], @@ -172,6 +173,18 @@ } ); +desc( 'Symlink llms.txt from shared if it exists' ); +task( 'link_llms_txt', function () { + $shared_file = get( 'deploy_path' ) . '/shared/llms.txt'; + $release_file = get( 'release_path' ) . '/llms.txt'; + + if ( test( "[ -f $shared_file ]" ) ) { + run( "ln -sfn $shared_file $release_file" ); + } +} ); + +after( 'deploy:shared', 'link_llms_txt' ); + $wp_tasks = [ 'deploy:prepare', 'deploy:unlock', From 8edc566d3b75e8dbe9c48a3f79b5e0fc7767ec9a Mon Sep 17 00:00:00 2001 From: Immanuel Raj Date: Wed, 29 Apr 2026 18:01:49 +0530 Subject: [PATCH 2/2] refactor: address Copilot review on llms:link task - Rename task to llms:link to follow namespace:action convention - Use {{shared_path}} and {{release_path}} Deployer placeholders instead of constructing paths manually via get('deploy_path') - Quote paths in test() and run() to handle spaces in deploy paths - Removes intermediate PHP variables, now uses placeholders directly --- deploy.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/deploy.php b/deploy.php index 5628567..bf1a66e 100644 --- a/deploy.php +++ b/deploy.php @@ -174,16 +174,13 @@ } ); desc( 'Symlink llms.txt from shared if it exists' ); -task( 'link_llms_txt', function () { - $shared_file = get( 'deploy_path' ) . '/shared/llms.txt'; - $release_file = get( 'release_path' ) . '/llms.txt'; - - if ( test( "[ -f $shared_file ]" ) ) { - run( "ln -sfn $shared_file $release_file" ); +task( 'llms:link', function () { + if ( test( '[ -f "{{shared_path}}/llms.txt" ]' ) ) { + run( 'ln -sfn "{{shared_path}}/llms.txt" "{{release_path}}/llms.txt"' ); } } ); -after( 'deploy:shared', 'link_llms_txt' ); +after( 'deploy:shared', 'llms:link' ); $wp_tasks = [ 'deploy:prepare',