-
Notifications
You must be signed in to change notification settings - Fork 2
/
cli.js
executable file
·20 lines (17 loc) · 668 Bytes
/
cli.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env node
import { identifyIssuer } from './dist/identifyIssuer.js'
const iccid = process.argv[process.argv.length - 1]
const issuer = identifyIssuer(iccid)
if (issuer !== undefined) {
console.log(JSON.stringify(issuer, null, 2))
} else {
console.error(`The vendor of your ICCID "${iccid}" could not be identified!`)
console.error(
`Please open a new issue by following this link: https://github.com/bifravst/e118-iin-list/issues/new?title=${encodeURIComponent(
`Could not identify ICCID ${iccid.replace(/.{6}$/, 'XXXXXX')}`,
)}&body=${encodeURIComponent(
'<!-- Please provide details about the SIM vendor. -->',
)}`,
)
process.exit(1)
}