diff --git a/src/lib/dev-environment/dev-environment-cli.ts b/src/lib/dev-environment/dev-environment-cli.ts index 1e3263c89..0de708926 100644 --- a/src/lib/dev-environment/dev-environment-cli.ts +++ b/src/lib/dev-environment/dev-environment-cli.ts @@ -18,6 +18,7 @@ import { readEnvironmentData, } from './dev-environment-core'; import { validateDockerInstalled } from './dev-environment-lando'; +import { getCurrentUserInfo } from '../api/user'; import { Args } from '../cli/command'; import { DEV_ENVIRONMENT_FULL_COMMAND, @@ -62,7 +63,7 @@ const componentDisplayNames: Record< string > = { wordpress: 'WordPress', - muPlugins: 'vip-go-mu-plugins', + muPlugins: 'VIP MU Plugins', appCode: 'application code', } as const; @@ -410,7 +411,18 @@ async function processComponent( ); let result: ComponentConfig; - const allowLocal = true; + let allowLocal: boolean = true; + + if ( component === 'muPlugins' ) { + let currentUser = null; + try { + currentUser = await getCurrentUserInfo(); + allowLocal = currentUser?.isVIP || false; + } catch ( err ) { + allowLocal = false; + } + } + const defaultObject = defaultValue ? processComponentOptionInput( defaultValue, allowLocal ) : null; @@ -746,7 +758,7 @@ export async function promptForComponent( const messagePrefix = selectMode ? '\t' : `${ componentDisplayName } - `; if ( 'local' === modeResult ) { const directoryPath = await promptForText( - `${ messagePrefix }What is a path to your local ${ componentDisplayName }`, + `${ messagePrefix }What is a path to your local ${ componentDisplayName }?`, defaultObject?.dir ?? '' ); return {