本文整理汇总了TypeScript中chalk.underline.bgMagenta方法的典型用法代码示例。如果您正苦于以下问题:TypeScript underline.bgMagenta方法的具体用法?TypeScript underline.bgMagenta怎么用?TypeScript underline.bgMagenta使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类chalk.underline
的用法示例。
在下文中一共展示了underline.bgMagenta方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: async
// delete and restore firestore
// delete (TODO) and restore authentication users
// delete and restore storage files
export default async (
foldername: string,
{
firestore,
storage,
accounts,
}: { firestore?: boolean; storage?: boolean; accounts?: boolean }
): Promise<void> => {
if (
!(await prompt<{ confirmed: boolean }>([
{
type: 'confirm',
name: 'confirmed',
message: chalk.underline.bgMagenta(
'Are you sure you want to restore from a backup? This WILL delete all live data in your firebase project!'
),
initial: false,
},
])).confirmed
) {
return;
}
console.log(' - now restoring');
const restoreAll = !firestore && !storage && !accounts;
try {
const projectId = await getProjectId();
await initializeAndEnsureAuth(projectId);
if (firestore || restoreAll) {
console.log('restoring firestore');
console.log('delete firestore');
await deleteFirestore();
console.log('import firestore');
await importFirestore(
path.join(resolveApp(foldername), 'firestore.json')
);
}
if (accounts || restoreAll) {
console.log('restoring authentication users');
await deleteAuthenticationUsers();
await importAuthenticationUsers(
path.join(resolveApp(foldername), 'accounts.json')
);
}
if (storage || restoreAll) {
console.log('restoring storage');
await deleteStorage(projectId);
// upload all files from backup
await importStorage(
projectId,
path.join(resolveApp(foldername), 'storage')
);
}
} catch (error) {
console.log(error);
}
};