Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

Commit 0264ada

Browse files
author
Fatme
authored
Don't clean the destination app folder when webpack process is already running. (#535)
Fixes the case when the user executes the following commands: tns run android --bundle --release --env.snapshot tns run android --bundle
1 parent a5c54c1 commit 0264ada

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

lib/before-cleanApp.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
const { cleanSnapshotArtefacts } = require("../snapshot/android/project-snapshot-generator");
22
const { isAndroid } = require("../projectHelpers");
3+
const { getWebpackProcess } = require("./compiler");
34

45
module.exports = function (hookArgs) {
5-
if (isAndroid(hookArgs.platformInfo.platform)) {
6-
cleanSnapshotArtefacts(hookArgs.platformInfo.projectData.projectDir);
6+
return (args, originalMethod) => {
7+
const webpackProcess = getWebpackProcess();
8+
const promise = webpackProcess ? Promise.resolve() : originalMethod(...args);
9+
return promise.then(() => {
10+
if (isAndroid(hookArgs.platformInfo.platform)) {
11+
cleanSnapshotArtefacts(hookArgs.platformInfo.projectData.projectDir);
12+
}
13+
});
714
}
815
}

0 commit comments

Comments
 (0)