Externalize spec typings, use eslint.
Tslint is deprecated, as such we have moved to eslint. Linted the project with more stringent rules. The configuration will be changed as we figure out which rules we should keep.
This commit is contained in:
@@ -4,24 +4,24 @@ import { JavaUtil } from './javautil'
|
||||
|
||||
export class PackXZExtractWrapper {
|
||||
|
||||
public static getPackXZExtract() {
|
||||
public static getPackXZExtract(): string {
|
||||
return join(process.cwd(), 'libraries', 'java', 'PackXZExtract.jar')
|
||||
}
|
||||
|
||||
public static extractUnpack(paths: string[]) {
|
||||
public static extractUnpack(paths: string[]): Promise<void> {
|
||||
return PackXZExtractWrapper.execute('-packxz', paths)
|
||||
}
|
||||
|
||||
public static extract(paths: string[]) {
|
||||
public static extract(paths: string[]): Promise<void> {
|
||||
return PackXZExtractWrapper.execute('-xz', paths)
|
||||
}
|
||||
|
||||
public static unpack(paths: string[]) {
|
||||
public static unpack(paths: string[]): Promise<void> {
|
||||
return PackXZExtractWrapper.execute('-pack', paths)
|
||||
}
|
||||
|
||||
private static execute(command: string, paths: string[]) {
|
||||
return new Promise((resolve, reject) => {
|
||||
private static execute(command: string, paths: string[]): Promise<void> {
|
||||
return new Promise(resolve => {
|
||||
const child = spawn(JavaUtil.getJavaExecutable(), [
|
||||
'-jar',
|
||||
PackXZExtractWrapper.getPackXZExtract(),
|
||||
@@ -30,7 +30,7 @@ export class PackXZExtractWrapper {
|
||||
])
|
||||
child.stdout.on('data', (data) => console.log('[PackXZExtract]', data.toString('utf8').trim()))
|
||||
child.stderr.on('data', (data) => console.error('[PackXZExtract]', data.toString('utf8').trim()))
|
||||
child.on('close', (code, signal) => {
|
||||
child.on('close', code => {
|
||||
console.log('[PackXZExtract]', 'Exited with code', code)
|
||||
resolve()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user