Skip to content

Commit

Permalink
fix(dev-env): demo code is displayed as [demo-image]
Browse files Browse the repository at this point in the history
  • Loading branch information
sjinks committed Jun 4, 2024
1 parent b81101c commit 5ffe851
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/dev-environment/dev-environment-cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ interface LocalComponent {

interface ImageComponent {
mode: 'image';
tag: string;
tag: string | undefined;
}

export function processComponentOptionInput(
Expand All @@ -258,7 +258,7 @@ export function processComponentOptionInput(

return {
mode: 'image',
tag: param,
tag: param === 'demo' ? undefined : param,
};
}

Expand Down
5 changes: 5 additions & 0 deletions src/lib/dev-environment/dev-environment-core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,11 @@ function parseComponentForInfo( component: ComponentConfig | WordPressConfig ):
if ( component.mode === 'local' ) {
return component.dir ?? '';
}

if ( component.tag === 'demo' ) {
component.tag = undefined;
}

return component.tag ?? '[demo-image]';
}

Expand Down

0 comments on commit 5ffe851

Please sign in to comment.