Skip to content

Commit

Permalink
fix: Make 'executable' opt optional (#726)
Browse files Browse the repository at this point in the history
  • Loading branch information
mykola-mokhnach authored Apr 1, 2024
1 parent a708640 commit e213744
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/adb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ export class ADB {
const options: ADBOptions = _.defaultsDeep(opts, _.cloneDeep(DEFAULT_OPTS));
_.defaultsDeep(this, options);

// avoid TS error by explicitly assigning
this.executable = options.executable;
// The above defaultsDeep call guarantees the 'executable' field to be always assigned
this.executable = options.executable as ADBExecutable;

if (options.remoteAdbHost) {
this.executable.defaultArgs.push('-H', options.remoteAdbHost);
Expand Down
2 changes: 1 addition & 1 deletion lib/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export interface ADBOptions {
keystorePassword?: string;
keyAlias?: string;
keyPassword?: string;
executable: ADBExecutable;
executable?: ADBExecutable;
tmpDir?: string;
curDeviceId?: string;
emulatorPort?: number;
Expand Down

0 comments on commit e213744

Please sign in to comment.