Skip to content

Commit d75cec7

Browse files
committed
Fixes from lint
1 parent 5f39025 commit d75cec7

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

src/se.ts

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,51 @@
1-
1+
import * as child from 'child_process';
2+
import * as fs from 'fs';
23

34
export function createMetaJson(): string[] {
45
return createMetaJson('./')
56
}
67

78
export function createMetaJson(root: string): string[] {
8-
var fs = require('fs');
9-
const execSync = require('child_process').execSync;
9+
const execSync = child.execSync;
1010

1111
const xmllint = execSync('sudo apt install libxml2-utils', { shell: '/bin/bash' });
1212
console.log(xmllint.toString());
13-
var command = `#!/bin/bash
13+
let command = `#!/bin/bash
1414
cd ` + root + `
1515
find . -name 'pom.xml' -type f > ` + root + `poms.txt
1616
`;
1717
const output = execSync(command, { shell: '/bin/bash' });
1818
console.log(output.toString());
1919

20-
var poms = fs.readFileSync(root + 'poms.txt', 'utf8').toString();
21-
var ownersFile = fs.readFileSync(root + '.github/CODEOWNERS', 'utf8').toString();
20+
let poms = fs.readFileSync(root + 'poms.txt', 'utf8').toString();
21+
let ownersFile = fs.readFileSync(root + '.github/CODEOWNERS', 'utf8').toString();
2222
for (const pomRaw of poms.split('\n')) {
23-
var pom = pomRaw.replace("\.\/", "/");
24-
var name = pom.split("/")[2];
23+
let pom = pomRaw.replace("./", "/");
24+
let name = pom.split("/")[2];
2525
if (pom.startsWith("/components") && pom.indexOf(name + "-deployment/") > -1) {
26-
var xml = fs.readFileSync(pomRaw, 'utf8');
27-
var owners = [];
28-
var reviewers = [];
26+
let owners = [];
27+
let reviewers = [];
2928
for (const ownerRaw of ownersFile.split('\n')) {
30-
var path = ownerRaw.split(' ')[0];
29+
let path = ownerRaw.split(' ')[0];
3130

3231
if (path.length > 3 && ownerRaw.indexOf(' @') > -1 && pom.startsWith(path)) {
3332
owners.push(ownerRaw.split(' ')[1])
3433
reviewers.push(ownerRaw.split(' ')[1])
3534
}
3635
}
37-
var gid = `#!/bin/bash
36+
let gid = `#!/bin/bash
3837
cd ` + root + `
3938
xmllint --xpath "/*[local-name()='project']/*[local-name()='groupId']/text()" ` + pom + `
4039
`
41-
var aid = `#!/bin/bash
40+
let aid = `#!/bin/bash
4241
cd ` + root + `
4342
xmllint --xpath "/*[local-name()='project']/*[local-name()='artifactId']/text()" ` + pom + `
4443
`
4544
const groupId = execSync(gid, { shell: '/bin/bash' }).toString();
4645
console.log(groupId);
4746
const artifactId = execSync(aid, { shell: '/bin/bash' }).toString();
4847
console.log(artifactId);
49-
var meta = {};
48+
let meta = {};
5049
meta['manifestSource'] = pom.replace("/pom.xml", "").substring(1);
5150
meta['manifestTarget'] = "helm-chart/components/charts/" + name + "/" + name + "-deployment/templates/";
5251
meta['owners'] = owners;

0 commit comments

Comments
 (0)