fix: musn't delete files on test enviroment
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Vicent Llopis 2022-07-21 13:16:30 +02:00
parent 2a41c1bb93
commit 5491fce0c6
1 changed files with 4 additions and 0 deletions

View File

@ -1,3 +1,4 @@
const UserError = require('vn-loopback/util/user-error');
const fs = require('fs-extra');
const path = require('path');
@ -26,6 +27,9 @@ module.exports = Self => {
myOptions.transaction = tx;
try {
if (process.env.NODE_ENV == 'test')
throw new UserError(`Action not allowed on the test environment`);
const models = Self.app.models;
const DmsContainer = models.DmsContainer;