mirror of
https://github.com/strapi/strapi.git
synced 2025-09-27 09:25:46 +00:00
check strapi exists before running restore
This commit is contained in:
parent
db8dac601f
commit
7a9a1d27ba
@ -96,13 +96,13 @@ class LocalStrapiDestinationProvider implements IDestinationProvider {
|
|||||||
if (!this.strapi) {
|
if (!this.strapi) {
|
||||||
throw new Error('Not able to stream Configurations. Strapi instance not found');
|
throw new Error('Not able to stream Configurations. Strapi instance not found');
|
||||||
}
|
}
|
||||||
const strapi = this.strapi;
|
|
||||||
return new Writable({
|
return new Writable({
|
||||||
objectMode: true,
|
objectMode: true,
|
||||||
write: async (config: IConfiguration, _encoding, callback) => {
|
write: async (config: IConfiguration, _encoding, callback) => {
|
||||||
try {
|
try {
|
||||||
if (this.options.strategy === 'restore') {
|
if (this.options.strategy === 'restore' && this.strapi) {
|
||||||
await restoreConfigs(strapi, config);
|
await restoreConfigs(this.strapi, config);
|
||||||
}
|
}
|
||||||
callback();
|
callback();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user