Skip to content

Commit 931fcaf

Browse files
committed
feat(import): list ignored devices and more compact view
1 parent 54bdd0a commit 931fcaf

File tree

1 file changed

+27
-11
lines changed

1 file changed

+27
-11
lines changed

cli/commands/import-devices.ts

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -87,17 +87,22 @@ export const importDevicesCommand = ({
8787
const existingDevices = Object.keys(existing)
8888

8989
console.log(
90-
table([
91-
['Fingerprint', 'Device ID', 'Model', 'HW version'],
92-
...Array.from(devices.entries())
93-
.filter(([imei]) => !existingDevices.includes(`oob-${imei}`))
94-
.map(([imei, { fingerprint, hwVersion }]) => [
95-
chalk.green(fingerprint),
96-
chalk.blue(imei),
97-
chalk.blue(model),
98-
chalk.blue(hwVersion),
99-
]),
100-
]),
90+
table(
91+
[
92+
['Fingerprint', 'Device ID', 'Model', 'HW version'],
93+
...Array.from(devices.entries())
94+
.filter(([imei]) => !existingDevices.includes(`oob-${imei}`))
95+
.map(([imei, { fingerprint, hwVersion }]) => [
96+
chalk.green(fingerprint),
97+
chalk.blue(imei),
98+
chalk.blue(model),
99+
chalk.blue(hwVersion),
100+
]),
101+
],
102+
{
103+
singleLine: true,
104+
},
105+
),
101106
)
102107

103108
if (existingDevices.length > 0) {
@@ -109,6 +114,17 @@ export const importDevicesCommand = ({
109114
),
110115
)
111116
console.warn('')
117+
console.warn(
118+
table(
119+
[
120+
['Device ID'],
121+
...existingDevices.map((imei) => [chalk.yellow(imei)]),
122+
],
123+
{
124+
singleLine: true,
125+
},
126+
),
127+
)
112128
}
113129

114130
if (dryRun === true) {

0 commit comments

Comments
 (0)