@@ -49014,103 +49014,103 @@ function wrappy (fn, cb) {
49014
49014
/***/ 4351:
49015
49015
/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => {
49016
49016
49017
- const core = __nccwpck_require__(2186);
49018
- const glob = __nccwpck_require__(1957);
49019
- const { validateFromFile } = __nccwpck_require__(5570);
49020
-
49021
- const usage = `
49022
- Usage: validate-entity [OPTION] [FILE]
49023
-
49024
- Validates Backstage entity definition files. Files may be specified as
49025
- arguments or via STDIN, one per line.
49026
-
49027
- OPTION:
49028
- -h display help
49029
- -q minimal output while validating entities
49030
- -i validate files provided over standard input
49031
- `.trim();
49032
-
49033
- async function validate(files, { github, verbose }) {
49034
- for (const file of files) {
49035
- try {
49036
- if (github) {
49037
- core.setOutput('time', new Date().toTimeString());
49038
- }
49039
- await validateFromFile(file, verbose);
49040
- } catch (err) {
49041
- if (github) {
49042
- core.setFailed(`Action failed with error: ${err.message}`);
49043
- } else {
49044
- console.error(`Failed to validate ${file}: ${err.message}`);
49045
- }
49046
- return 1;
49047
- }
49048
- }
49049
- return 0;
49050
- }
49051
-
49052
- async function main() {
49053
- const argv = __nccwpck_require__(5871)(process.argv.slice(2), {
49054
- boolean: ['h', 'i', 'q'],
49055
- default: {
49056
- // help
49057
- h: false,
49058
- // read file(s) to validate from STDIN
49059
- i: false,
49060
- // quiet output
49061
- q: false,
49062
- }
49063
- });
49064
-
49065
- if (argv.h) {
49066
- console.log(usage);
49067
- return 0;
49068
- }
49069
-
49070
- const options = {
49071
- verbose: !argv.q,
49072
- github: false,
49073
- };
49074
-
49075
- // files to validate
49076
- let files = [];
49077
-
49078
- // this will be empty in non-github environments
49079
- const ghPath = core.getInput('path');
49080
- if (ghPath) {
49081
- // add one or more files seperated by comma
49082
- files = files.concat(ghPath.split(','));
49083
- options.github = true;
49084
- }
49085
-
49086
- const ghVerbose = core.getInput('verbose');
49087
- if (ghVerbose) {
49088
- options.verbose = ghVerbose === 'true';
49089
- }
49090
-
49091
- // add files specified as arguments
49092
- files = files.concat(argv._);
49093
-
49094
- if (argv.i) {
49095
- // add files specified over STDIN
49096
- files = files.concat(__nccwpck_require__(5747).readFileSync(0)
49097
- .toString()
49098
- .split('\n')
49099
- .filter(l => l.length > 0));
49100
- }
49101
-
49102
- // Expand glob patterns like services/*/catalog.yaml into a list of files
49103
- files = files.map(file => glob.sync(file)).flat();
49104
-
49105
- if (files.length === 0) {
49106
- console.error('No files specified to validate');
49107
- return 1;
49108
- }
49109
-
49110
- return await validate(files, options);
49111
- }
49112
-
49113
- main().then(process.exit);
49017
+ const core = __nccwpck_require__(2186);
49018
+ const glob = __nccwpck_require__(1957);
49019
+ const { validateFromFile } = __nccwpck_require__(5570);
49020
+
49021
+ const usage = `
49022
+ Usage: validate-entity [OPTION] [FILE]
49023
+
49024
+ Validates Backstage entity definition files. Files may be specified as
49025
+ arguments or via STDIN, one per line.
49026
+
49027
+ OPTION:
49028
+ -h display help
49029
+ -q minimal output while validating entities
49030
+ -i validate files provided over standard input
49031
+ `.trim();
49032
+
49033
+ async function validate(files, { github, verbose }) {
49034
+ for (const file of files) {
49035
+ try {
49036
+ if (github) {
49037
+ core.setOutput('time', new Date().toTimeString());
49038
+ }
49039
+ await validateFromFile(file, verbose);
49040
+ } catch (err) {
49041
+ if (github) {
49042
+ core.setFailed(`Action failed with error: ${err.message}`);
49043
+ } else {
49044
+ console.error(`Failed to validate ${file}: ${err.message}`);
49045
+ }
49046
+ return 1;
49047
+ }
49048
+ }
49049
+ return 0;
49050
+ }
49051
+
49052
+ async function main() {
49053
+ const argv = __nccwpck_require__(5871)(process.argv.slice(2), {
49054
+ boolean: ['h', 'i', 'q'],
49055
+ default: {
49056
+ // help
49057
+ h: false,
49058
+ // read file(s) to validate from STDIN
49059
+ i: false,
49060
+ // quiet output
49061
+ q: false,
49062
+ }
49063
+ });
49064
+
49065
+ if (argv.h) {
49066
+ console.log(usage);
49067
+ return 0;
49068
+ }
49069
+
49070
+ const options = {
49071
+ verbose: !argv.q,
49072
+ github: false,
49073
+ };
49074
+
49075
+ // files to validate
49076
+ let files = [];
49077
+
49078
+ // this will be empty in non-github environments
49079
+ const ghPath = core.getInput('path');
49080
+ if (ghPath) {
49081
+ // add one or more files seperated by comma
49082
+ files = files.concat(ghPath.split(','));
49083
+ options.github = true;
49084
+ }
49085
+
49086
+ const ghVerbose = core.getInput('verbose');
49087
+ if (ghVerbose) {
49088
+ options.verbose = ghVerbose === 'true';
49089
+ }
49090
+
49091
+ // add files specified as arguments
49092
+ files = files.concat(argv._);
49093
+
49094
+ if (argv.i) {
49095
+ // add files specified over STDIN
49096
+ files = files.concat(__nccwpck_require__(5747).readFileSync(0)
49097
+ .toString()
49098
+ .split('\n')
49099
+ .filter(l => l.length > 0));
49100
+ }
49101
+
49102
+ // Expand glob patterns like services/*/catalog.yaml into a list of files
49103
+ files = files.map(file => glob.sync(file)).flat();
49104
+
49105
+ if (files.length === 0) {
49106
+ console.error('No files specified to validate');
49107
+ return 1;
49108
+ }
49109
+
49110
+ return await validate(files, options);
49111
+ }
49112
+
49113
+ main().then(process.exit);
49114
49114
49115
49115
49116
49116
/***/ }),
0 commit comments