Avoid write files if not development environment

This commit is contained in:
Abdón Rodríguez Davila 2018-12-19 19:25:52 +01:00
parent 1233d5fac9
commit a5dc07c0a5
2 changed files with 8 additions and 2 deletions

View File

@ -266,8 +266,10 @@ module.exports = {
resolvers, resolvers,
}); });
if (strapi.config.environment === 'development') {
// Write schema. // Write schema.
this.writeGenerateSchema(graphql.printSchema(schema)); this.writeGenerateSchema(graphql.printSchema(schema));
}
// Remove custom scaler (like Upload); // Remove custom scaler (like Upload);
typeDefs = Types.removeCustomScalar(typeDefs, resolvers); typeDefs = Types.removeCustomScalar(typeDefs, resolvers);

View File

@ -88,6 +88,10 @@ module.exports = async function() {
return; return;
} }
if (strapi.config.environment !== 'development') {
return;
}
// arrange system directories // arrange system directories
await Promise.all([ await Promise.all([
fs.remove(sourcePath), fs.remove(sourcePath),