Skip to content

Commit

Permalink
Use CFBundleName as fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
charpeni committed Apr 10, 2019
1 parent 480d30e commit 72302e8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 4 additions & 0 deletions __tests__/__snapshots__/getAppsByDevice.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ Array [
Object {
"CFBundleDisplayName": "pasta",
"CFBundleIdentifier": "org.reactjs.native.example.pasta",
"CFBundleName": "example",
"CFBundleShortVersionString": "3.0",
"CFBundleVersion": "8",
"file": "/Devices/148019A3-566F-4C21-A4FC-6FD75D9F051E/data/Containers/Bundle/Application/43FB53D5-6F42-4F38-A810-6C1A28B393E9/example.app",
},
Object {
"CFBundleDisplayName": "example",
"CFBundleIdentifier": "org.reactjs.native.example.example",
"CFBundleName": "example",
"CFBundleShortVersionString": "1.0",
"CFBundleVersion": "1",
"file": "/Devices/148019A3-566F-4C21-A4FC-6FD75D9F051E/data/Containers/Bundle/Application/950806E1-3259-4089-8EF3-DF0941E3B5B7/example.app",
Expand All @@ -33,6 +35,7 @@ Array [
Object {
"CFBundleDisplayName": "example",
"CFBundleIdentifier": "org.reactjs.native.example.example",
"CFBundleName": "example",
"CFBundleShortVersionString": "1.0",
"CFBundleVersion": "1",
"file": "/Devices/1E756F87-FF14-45C0-9775-A4469F72599E/data/Containers/Bundle/Application/B3674201-2F90-4759-988E-CDB42181FD80/example.app",
Expand Down Expand Up @@ -60,6 +63,7 @@ Array [
Object {
"CFBundleDisplayName": "example",
"CFBundleIdentifier": "org.reactjs.native.example.example",
"CFBundleName": "example",
"CFBundleShortVersionString": "1.0",
"CFBundleVersion": "1",
"file": "/Devices/C321F874-FA51-4DC5-8B9A-2E6E095D8C90/data/Containers/Bundle/Application/4FEF6828-573D-4ACA-922D-85C1EEA7E509/example.app",
Expand Down
2 changes: 2 additions & 0 deletions getAppsByDevice.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ function getAppsByDevice(searchingPath = homedir() + DEVICES_PATH) {

const {
CFBundleDisplayName,
CFBundleName,
CFBundleIdentifier,
CFBundleShortVersionString,
CFBundleVersion,
Expand All @@ -51,6 +52,7 @@ function getAppsByDevice(searchingPath = homedir() + DEVICES_PATH) {
return {
file,
CFBundleDisplayName,
CFBundleName,
CFBundleIdentifier,
CFBundleShortVersionString,
CFBundleVersion,
Expand Down
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ async function selectAnApp(devices) {
...device.apps.map(app => ({
name: `${device.name} (${prettifyRuntimeVersion(
device.runtime
)}) - ${app.CFBundleDisplayName} [${app.CFBundleIdentifier} - ${
app.CFBundleVersion
}]`,
)}) - ${app.CFBundleDisplayName || app.CFBundleName} [${
app.CFBundleIdentifier
} - ${app.CFBundleVersion}]`,
value: {
device,
app,
Expand Down

0 comments on commit 72302e8

Please sign in to comment.