@tywalk/pcf-helper 1.4.13 → 1.4.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,42 +0,0 @@
1
- const { spawnSync } = require('child_process');
2
- const { formatMsToSec, formatTime } = require('../util/performanceUtil');
3
- const logger = require('@tywalk/color-logger').default;
4
-
5
- /**
6
- * Upgrades the Power Apps component framework project.
7
- *
8
- * @param {string} path The path to the project folder containing the pcfproj.json file.
9
- *
10
- * @returns {number} The exit code of the spawned process.
11
- */
12
- function run(path) {
13
- logger.log('[PCF Helper] ' + formatTime(new Date()) + ' Starting upgrade...\n');
14
- const tick = performance.now();
15
- const task = spawnSync(`pac solution version -s Solution -sp ${path} && pac pcf version -s Manifest && npm version patch --no-git-tag-version`, {
16
- cwd: process.cwd(),
17
- stdio: 'inherit',
18
- shell: true,
19
- timeout: 1000 * 60 // 1 min
20
- });
21
- const tock = performance.now();
22
-
23
- if (task.status === 0) {
24
- logger.success('[PCF Helper] Upgrade complete!');
25
- logger.debug(formatMsToSec('[PCF Helper] ' + formatTime(new Date()) + ' Upgrade finished in %is.\n', tock - tick));
26
- } else {
27
- if (task.error) {
28
- if (task.signal === 'SIGTERM') {
29
- logger.error('[PCF Helper] Unable to complete upgrade. A timeout of 1 minutes was reached.', task.error.message);
30
- } else {
31
- logger.error('[PCF Helper] Unable to complete upgrade:', task.signal, task.error.message);
32
- }
33
- logger.debug('[PCF Helper] Error details:', task.signal, task.error.stack);
34
- } else {
35
- logger.error('[PCF Helper] Unable to complete upgrade: One or more errors ocurred.');
36
- }
37
- logger.debug(formatMsToSec('[PCF Helper] ' + formatTime(new Date()) + ' Upgrade finished with errors in %is.\n', tock - tick));
38
- }
39
- return task.status;
40
- }
41
-
42
- exports.run = run;