File tree Expand file tree Collapse file tree
apps/cli/lib/dependency-management Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -58,8 +58,12 @@ export function getBlueprintsPharPath(): string {
5858
5959// Static Site Importer ships read-only with the CLI bundle (downloaded at npm
6060// install time by `scripts/download-wp-server-files.ts`) and is symlinked into
61- // each site's mu-plugins temp directory. No writable cache needed — the
62- // bundled directory is treated as the source of truth .
61+ // each site's mu-plugins temp directory. Bench harnesses may override that
62+ // bundled copy to test an active SSI worktree .
6363export function getStaticSiteImporterPluginPath ( ) : string {
64+ if ( process . env . STUDIO_STATIC_SITE_IMPORTER_PLUGIN_PATH ) {
65+ return process . env . STUDIO_STATIC_SITE_IMPORTER_PLUGIN_PATH ;
66+ }
67+
6468 return path . join ( getWpFilesPath ( ) , 'static-site-importer' ) ;
6569}
Original file line number Diff line number Diff line change 1+ import path from 'path' ;
2+ import { afterEach , describe , expect , it } from 'vitest' ;
3+ import { getStaticSiteImporterPluginPath } from '../paths' ;
4+
5+ describe ( 'dependency path helpers' , ( ) => {
6+ afterEach ( ( ) => {
7+ delete process . env . STUDIO_STATIC_SITE_IMPORTER_PLUGIN_PATH ;
8+ } ) ;
9+
10+ it ( 'uses the requested Static Site Importer plugin path when provided' , ( ) => {
11+ process . env . STUDIO_STATIC_SITE_IMPORTER_PLUGIN_PATH =
12+ '/tmp/static-site-importer-worktree' ;
13+
14+ expect ( getStaticSiteImporterPluginPath ( ) ) . toBe ( '/tmp/static-site-importer-worktree' ) ;
15+ } ) ;
16+
17+ it ( 'falls back to the bundled Static Site Importer plugin path' , ( ) => {
18+ expect ( getStaticSiteImporterPluginPath ( ) ) . toContain (
19+ path . join ( 'wp-files' , 'static-site-importer' )
20+ ) ;
21+ } ) ;
22+ } ) ;
You can’t perform that action at this time.
0 commit comments