Skip to content

Commit

Permalink
use execa Options
Browse files Browse the repository at this point in the history
  • Loading branch information
0618 committed Jan 27, 2024
1 parent a234d1b commit 30cd61e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { existsSync as _existsSync } from 'fs';
import _fsp from 'fs/promises';
import { ExecaChildProcess, execa as _execa } from 'execa';
import { ExecaChildProcess, type Options, execa as _execa } from 'execa';
import * as _path from 'path';
import { type PackageManagerController } from '@aws-amplify/plugin-types';
import { LogLevel } from '../printer/printer.js';
Expand Down Expand Up @@ -123,13 +123,7 @@ Get started by running \`${this.binaryRunner} amplify sandbox\`.`;
runWithPackageManager(

Check failure on line 123 in packages/cli-core/src/package-manager-controller/package_manager_controller_base.ts

View workflow job for this annotation

GitHub Actions / build

Property 'runWithPackageManager' in type 'PackageManagerControllerBase' is not assignable to the same property in base type 'PackageManagerController'.
args: string[] = [],
dir: string,
options?: {
env?: Record<string, string>;
stdin?: 'inherit' | 'pipe' | 'ignore';
stdout?: 'inherit' | 'pipe' | 'ignore';
stderr?: 'inherit' | 'pipe' | 'ignore';
extendEnv?: boolean;
}
options?: Options
): ExecaChildProcess<string> {
return this.executeWithDebugLogger(
dir,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,7 @@ export const runWithPackageManager = (
packageManager: PackageManager,
args: string[] = [],
dir: string,
options?: {
env?: Record<string, string>;
}
options?: Options
): ProcessController => {
let packageManagerBinary: PackageManagerExecutable;
switch (packageManager) {
Expand Down
10 changes: 2 additions & 8 deletions packages/plugin-types/src/package_manager_controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* execa v8 doesn't support commonjs, so we need to use the types from v5
* https://github.com/sindresorhus/execa/issues/489#issuecomment-1109983390
*/
import { type ExecaChildProcess } from 'execa';
import { type ExecaChildProcess, type Options } from 'execa';

export type DependencyType = 'dev' | 'prod';

Expand All @@ -19,12 +19,6 @@ export type PackageManagerController = {
runWithPackageManager: (
args: string[] | undefined,
dir: string,
options?: {
env?: Record<string, string>;
stdin?: 'inherit' | 'pipe' | 'ignore';
stdout?: 'inherit' | 'pipe' | 'ignore';
stderr?: 'inherit' | 'pipe' | 'ignore';
extendEnv?: boolean;
}
options?: Options
) => ExecaChildProcess<string>;
};

0 comments on commit 30cd61e

Please sign in to comment.