forked from LedgerHQ/ledger-live
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cli): add listApps to display all installed apps on device (Ledg…
…erHQ#5349) * feat(cli): add listApps to display all installed apps on device * feat(cli): add listApps description and documentation
- Loading branch information
1 parent
317685e
commit 57497fb
Showing
4 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@ledgerhq/live-cli": patch | ||
--- | ||
|
||
add listApps command to display all installed apps on device |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { from, tap } from "rxjs"; | ||
import { withDevice } from "@ledgerhq/live-common/hw/deviceAccess"; | ||
import listApps from "@ledgerhq/live-common/hw/listApps"; | ||
import { deviceOpt } from "../scan"; | ||
|
||
export default { | ||
description: "list all installed apps on the device", | ||
args: [deviceOpt], | ||
job: ({ | ||
device, | ||
}: Partial<{ | ||
device: string; | ||
}>) => | ||
withDevice(device || "")(t => | ||
from(listApps(t)).pipe( | ||
tap(res => { | ||
console.log(res); | ||
}), | ||
), | ||
), | ||
}; |