Skip to content

Commit 41c6757

Browse files
authored
run dos2unix on src/index.js (#36)
* run dos2unix on src/index.js * use the compiled indedx.js as entrypoint
1 parent ba3c8b0 commit 41c6757

File tree

5 files changed

+108
-104
lines changed

5 files changed

+108
-104
lines changed

dist/index.js

Lines changed: 97 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -49014,103 +49014,103 @@ function wrappy (fn, cb) {
4901449014
/***/ 4351:
4901549015
/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => {
4901649016

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);
4911449114

4911549115

4911649116
/***/ }),

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"name": "@roadiehq/backstage-entity-validator",
3-
"version": "0.3.8",
3+
"version": "0.3.9",
44
"author": "RoadieHQ",
55
"description": "Backstage entity validator",
6-
"main": "src/index.js",
6+
"main": "dist/index.js",
77
"license": "Apache-2.0",
88
"private": false,
99
"homepage": "https://github.com/RoadieHQ/backstage-entity-validator",
@@ -13,8 +13,7 @@
1313
},
1414
"repository": "https://github.com/RoadieHQ/backstage-entity-validator",
1515
"publishConfig": {
16-
"access": "public",
17-
"main": "dist/index.js"
16+
"access": "public"
1817
},
1918
"bin": {
2019
"validate-entity": "./bin/bev"

yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1264,6 +1264,11 @@
12641264
"resolved" "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz"
12651265
"version" "1.0.0"
12661266

1267+
"fsevents@^2.3.2":
1268+
"integrity" "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA=="
1269+
"resolved" "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz"
1270+
"version" "2.3.2"
1271+
12671272
"function-bind@^1.1.1":
12681273
"integrity" "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
12691274
"resolved" "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz"

0 commit comments

Comments
 (0)