Skip to content

Commit bf9afa3

Browse files
authored
Don't force the process to terminate (joomla#42341)
1 parent 12ce681 commit bf9afa3

File tree

8 files changed

+11
-15
lines changed

8 files changed

+11
-15
lines changed

build/build-modules-js/compilecss.es6.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ module.exports.stylesheets = async (options, path) => {
3333
} else {
3434
// eslint-disable-next-line no-console
3535
console.error(`Unknown path ${path}`);
36-
process.exit(1);
36+
process.exitCode = 1;
3737
}
3838
} else {
3939
folders = [

build/build-modules-js/compilejs.es6.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ module.exports.scripts = async (options, path) => {
3535
} else {
3636
// eslint-disable-next-line no-console
3737
console.error(`Unknown path ${path}`);
38-
process.exit(1);
38+
process.exitCode = 1;
3939
}
4040
} else {
4141
folders = [

build/build-modules-js/error-pages.es6.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ module.exports.createErrorPages = async (options) => {
112112
await Promise.all(iniFilesProcess).catch((err) => {
113113
// eslint-disable-next-line no-console
114114
console.error(err);
115-
process.exit(-1);
115+
process.exitCode = -1;
116116
});
117117

118118
const processPage = async (name) => {
@@ -163,6 +163,6 @@ module.exports.createErrorPages = async (options) => {
163163
return Promise.all(processPages).catch((err) => {
164164
// eslint-disable-next-line no-console
165165
console.error(err);
166-
process.exit(-1);
166+
process.exitCode = -1;
167167
});
168168
};

build/build-modules-js/init/cleanup-media.es6.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,6 @@ module.exports.cleanVendors = async () => {
4040
} else {
4141
// eslint-disable-next-line no-console
4242
console.error('You need to run `npm install` AFTER the command `composer install`!!!. The debug plugin HASN\'T installed all its front end assets');
43-
process.exit(1);
43+
process.exitCode = 1;
4444
}
4545
};

build/build-modules-js/javascript/build-bootstrap-js.es6.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ module.exports.bootstrapJs = async () => {
147147
} catch (error) {
148148
// eslint-disable-next-line no-console
149149
console.error(error);
150-
process.exit(1);
150+
process.exitCode = 1;
151151
}
152152

153153
(await readdir(outputFolder)).forEach((file) => {
@@ -168,11 +168,11 @@ module.exports.bootstrapJs = async () => {
168168
} catch (error) {
169169
// eslint-disable-next-line no-console
170170
console.error(error);
171-
process.exit(1);
171+
process.exitCode = 1;
172172
}
173173
}).catch((er) => {
174174
// eslint-disable-next-line no-console
175175
console.log(er);
176-
process.exit(1);
176+
process.exitCode = 1;
177177
});
178178
};

build/build-modules-js/stylesheets/handle-scss.es6.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module.exports.handleScssFile = async (file) => {
1616
} catch (error) {
1717
// eslint-disable-next-line no-console
1818
console.error(error.formatted);
19-
process.exit(1);
19+
process.exitCode = 1;
2020
}
2121

2222
let contents = LightningCSS.transform({

build/build-modules-js/stylesheets/scss-transform.es6.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module.exports.compile = async (file) => {
1414
} catch (error) {
1515
// eslint-disable-next-line no-console
1616
console.error(error.formatted);
17-
process.exit(1);
17+
process.exitCode = 1;
1818
}
1919

2020
// Auto prefixing

build/build.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const settings = require('./build-modules-js/settings.json');
4242

4343
const handleError = (err, terminateCode) => {
4444
console.error(err); // eslint-disable-line no-console
45-
process.exit(terminateCode);
45+
process.exitCode = terminateCode;
4646
};
4747

4848
if (semver.gte(semver.minVersion(options.engines.node), semver.clean(process.version))) {
@@ -95,9 +95,6 @@ if (cliOptions.copyAssets) {
9595
.then(() => localisePackages(options))
9696
.then(() => patchPackages(options))
9797
.then(() => minifyVendor())
98-
.then(() => {
99-
process.exit(0);
100-
})
10198
.catch((error) => handleError(error, 1));
10299
}
103100

@@ -170,6 +167,5 @@ if (cliOptions.prepare) {
170167
],
171168
))
172169
.then(() => bench.stop('Build'))
173-
.then(() => { process.exit(0); })
174170
.catch((err) => handleError(err, -1));
175171
}

0 commit comments

Comments
 (0)