Replace axios with got, check for empty version in forgemod meta.
This commit is contained in:
@@ -1,8 +1,12 @@
|
||||
import { createLogger, format, transports, Logger } from 'winston'
|
||||
import { SPLAT } from 'triple-beam'
|
||||
import { SPLAT as SPLAT_Symbol } from 'triple-beam'
|
||||
import moment from 'moment'
|
||||
import { inspect } from 'util'
|
||||
|
||||
// Workaround until fixed.
|
||||
// https://github.com/winstonjs/logform/issues/111
|
||||
const SPLAT = SPLAT_Symbol as unknown as string
|
||||
|
||||
export class LoggerUtil {
|
||||
|
||||
public static getLogger(label: string): Logger {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import Axios from 'axios'
|
||||
import got from 'got'
|
||||
import { PromotionsSlim } from '../model/forge/promotionsslim'
|
||||
import { MinecraftVersion } from './MinecraftVersion'
|
||||
import { LoggerUtil } from './LoggerUtil'
|
||||
@@ -39,12 +39,12 @@ export class VersionUtil {
|
||||
}
|
||||
|
||||
public static async getPromotionIndex(): Promise<PromotionsSlim> {
|
||||
const response = await Axios({
|
||||
const response = await got.get<PromotionsSlim>({
|
||||
method: 'get',
|
||||
url: 'https://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json',
|
||||
responseType: 'json'
|
||||
})
|
||||
return response.data as PromotionsSlim
|
||||
return response.body
|
||||
}
|
||||
|
||||
public static getPromotedVersionStrict(index: PromotionsSlim, minecraftVersion: MinecraftVersion, promotion: string): string {
|
||||
|
||||
Reference in New Issue
Block a user