Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
}
if (chunk.level === bunyan.INFO) {
log(chunk.msg);
} else if (chunk.level === bunyan.WARN) {
log.warn(chunk.msg);
} else if (chunk.level >= bunyan.ERROR) {
log.error(chunk.msg);
}
},
},
type: 'raw',
};
Logger.notifications.addStream(stream);
Logger.global.addStream(stream);
}
{ code: NotificationCode.INSTALL_SHELL_COMMANDS_RESULT },
`Shell commands ${binaries.join(', ')} are already installed`
);
return;
}
try {
await sudoAsync(commands.join('\n'), sudoOptions);
} catch (e) {
Logger.notifications.error(
{ code: NotificationCode.INSTALL_SHELL_COMMANDS_RESULT },
'Error installing shell commands'
);
throw e;
}
Logger.notifications.info(
{ code: NotificationCode.INSTALL_SHELL_COMMANDS_RESULT },
`Installed ${installedBinaries.join(', ')} to your shell`
);
}
}
}
if (chunk.level === bunyan.INFO) {
log(chunk.msg);
} else if (chunk.level === bunyan.WARN) {
log.warn(chunk.msg);
} else if (chunk.level >= bunyan.ERROR) {
log.error(chunk.msg);
}
},
},
type: 'raw',
};
Logger.notifications.addStream(stream);
Logger.global.addStream(stream);
}
_registerLogs() {
Logger.notifications.addStream({
stream: {
write: chunk => {
switch (chunk.code) {
case NotificationCode.OLD_IOS_APP_VERSION:
this._showNotification(
'warning',
'Expo app on iOS simulator is out of date. Click to upgrade.',
{},
async () => {
await Simulator.upgradeExpoAsync();
}
);
return;
case NotificationCode.OLD_ANDROID_APP_VERSION:
this._showNotification(
'warning',
componentDidMount() {
Logger.notifications.addStream({
stream: {
write: chunk => {
switch (chunk.code) {
case NotificationCode.PROGRESS:
this.setState({
loadingMessage: chunk.msg,
notificationType: NotificationCode.PROGRESS,
});
break;
case NotificationCode.DOWNLOAD:
this.setState({
loadingMessage: 'Downloading... ' + chunk.msg + '%',
progress: chunk.msg,
notificationType: NotificationCode.DOWNLOAD,
});
break;
_registerLogs() {
Logger.notifications.addStream({
stream: {
write: (chunk) => {
switch (chunk.code) {
case NotificationCode.OLD_IOS_APP_VERSION:
this._showNotification('warning', 'Exponent app on iOS simulator is out of date. Click to upgrade.', async () => {
await Simulator.upgradeExponentAsync();
});
return;
case NotificationCode.OLD_ANDROID_APP_VERSION:
this._showNotification('warning', 'Exponent app on Android device is out of date. Click to upgrade.', async () => {
await Android.upgradeExponentAsync();
});
return;
case NotificationCode.START_LOADING:
this.setState({
isLoading: true,
retryFunction: () =>
Logger.notifications.info(
{ code: NotificationCode.RETRY_DOWNLOAD },
MessageCode.DOWNLOAD_IS_SLOW
),
}