Skip to content

Commit

Permalink
refactor: Convert dev-environment-lando to TypeScript
Browse files Browse the repository at this point in the history
  • Loading branch information
sjinks committed Jul 6, 2023
1 parent 9b69db8 commit 72e975c
Show file tree
Hide file tree
Showing 33 changed files with 1,431 additions and 191 deletions.
2 changes: 1 addition & 1 deletion src/lib/dev-environment/dev-environment-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ export const validateDependencies = async ( lando: Lando, slug: string, quiet?:
}

try {
await validateDockerInstalled( lando );
validateDockerInstalled( lando );
} catch ( exception ) {
throw new UserError( exception.message );
}
Expand Down
9 changes: 6 additions & 3 deletions src/lib/dev-environment/dev-environment-core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
landoStop,
landoRebuild,
landoLogs,
LandoLogsOptions,
} from './dev-environment-lando';
import { searchAndReplace } from '../search-and-replace';
import {
Expand Down Expand Up @@ -306,7 +307,7 @@ function parseComponentForInfo( component: ComponentConfig | WordPressConfig ):
export async function showLogs(
lando: Lando,
slug: string,
options: Record< string, string > = {}
options: LandoLogsOptions = {}
): Promise< unknown > {
debug( 'Will display logs command on env', slug, 'with options', options );

Expand All @@ -315,10 +316,12 @@ export async function showLogs(
debug( 'Instance path for', slug, 'is:', instancePath );

if ( options.service ) {
const appInfo: { services: string } = await landoInfo( lando, instancePath, false );
const appInfo = await landoInfo( lando, instancePath );
if ( ! appInfo.services.includes( options.service ) ) {
throw new UserError(
`Service '${ options.service }' not found. Please choose from one: ${ appInfo.services }`
`Service '${
options.service
}' not found. Please choose from one: ${ appInfo.services.toString() }`
);
}
}
Expand Down
Loading

0 comments on commit 72e975c

Please sign in to comment.