Skip to content

Commit

Permalink
fix(vip-helpers): detect codespace as a non-prod environment (#4873)
Browse files Browse the repository at this point in the history
  • Loading branch information
sjinks authored Sep 21, 2023
1 parent 2e80dc0 commit e343590
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion vip-helpers/vip-non-production.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,15 @@ function vip_do_non_prod_bar() {
}

if ( apply_filters( 'vip_show_non_prod_bar', true ) ) :
$environment = constant( 'VIP_GO_APP_ENVIRONMENT' );
if ( 'local' === $environment && 'true' === getenv( 'CODESPACES' ) ) {
$environment = 'codespaces';
}

?>
<div id="vip-non-prod-bar">
<span>
<strong><?php echo esc_html( constant( 'VIP_GO_APP_ENVIRONMENT' ) ); ?></strong>
<strong><?php echo esc_html( $environment ); ?></strong>
</span>
</div>
<script>
Expand Down

0 comments on commit e343590

Please sign in to comment.