terraguardian-cli 0.2.0 → 0.2.1
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.
package/package.json
CHANGED
package/src/common/helpers.js
CHANGED
|
@@ -3,12 +3,23 @@ const FileHandler = require('../fs-utils/FileHandler');
|
|
|
3
3
|
const exec = util.promisify(require('child_process').exec);
|
|
4
4
|
|
|
5
5
|
async function executeCommand(command) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
return new Promise((resolve, reject) => {
|
|
7
|
+
exec(command, (error, stdout, stderr) => {
|
|
8
|
+
console.log(stdout);
|
|
9
|
+
|
|
10
|
+
// If stderr contains file size info or non-critical messages, ignore it
|
|
11
|
+
if (stderr) {
|
|
12
|
+
// If stderr contains the file size info pattern, just log it, don't throw
|
|
13
|
+
if (stderr.includes('kb') || stderr.includes('mb')) {
|
|
14
|
+
console.log('Build info (stderr):', stderr);
|
|
15
|
+
} else {
|
|
16
|
+
reject(new Error(stderr)); // Reject for actual errors
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
resolve(stdout); // Resolve with the output if everything is fine
|
|
21
|
+
});
|
|
22
|
+
});
|
|
12
23
|
}
|
|
13
24
|
|
|
14
25
|
function getLineOfInterest(
|
|
@@ -18,7 +18,6 @@ function getEsbuildBuildCommand(lambdaName, lambdaPath, buildOutputDir) {
|
|
|
18
18
|
'--platform=node', // Set platform to node for AWS Lambda
|
|
19
19
|
'--target=node20', // Change as needed for your Lambda runtime
|
|
20
20
|
`--outfile=${buildOutputDir}/${NODE_BUILD_FILE_NAME}`, // Output file name
|
|
21
|
-
'--sourcemap', // Optional: generate sourcemaps for debugging
|
|
22
21
|
'--minify', // Optional: minify the output (you can disable if not needed)
|
|
23
22
|
];
|
|
24
23
|
|