cli: just print warning if postpack fails

This commit is contained in:
Patrik Oldsberg
2020-07-31 10:19:17 +02:00
parent 21c57181f0
commit 5c79a0d314
+8 -1
View File
@@ -39,5 +39,12 @@ export const pre = async () => {
export const post = async () => {
// postpack isn't called by yarn right now, so it needs to be called manually
await fs.move(PKG_BACKUP_PATH, PKG_PATH, { overwrite: true });
try {
await fs.move(PKG_BACKUP_PATH, PKG_PATH, { overwrite: true });
} catch (error) {
console.warn(
`Failed to restore package.json during postpack, ${error}. ` +
'Your package will be fine but you may have ended up with some garbage in the repo.',
);
}
};