feat:基本最终完成
This commit is contained in:
@@ -18,6 +18,8 @@ export async function DeEarthMain(modspath: string, movepath: any) {
|
||||
fs.mkdirSync(movepath)
|
||||
}
|
||||
LOGGER.info(`DeEarth V1.0.0`)
|
||||
LOGGER.info(`如有无法筛选的mods,请前往 https://dearth.0771010.xyz/ 提交未成功筛选的模组的modid`)
|
||||
LOGGER.info(`Probejs 7.0.0以上版本为非客户端mod,如rubbish中有请自行添加回去`)
|
||||
const resaddr = fs.readdirSync(modspath)
|
||||
LOGGER.info(`获取目录列表,一共${resaddr.length}个jar文件。`)
|
||||
const totalBar = multibar.create(resaddr.length, 0, { filename: '总文件数' })
|
||||
|
||||
@@ -32,7 +32,7 @@ function error(error: object | string) {
|
||||
console.log(
|
||||
`[${chalk.blue(
|
||||
new Date().toLocaleDateString() + " " + new Date().toLocaleTimeString()
|
||||
)}](${process.pid})[${chalk.red("ERROR")}:${error.toString()}`
|
||||
)}](${process.pid})[${chalk.red("ERROR")}:${JSON.stringify(error)}`
|
||||
);
|
||||
} else {
|
||||
console.log(
|
||||
|
||||
@@ -3,7 +3,9 @@ import pRetry from "p-retry";
|
||||
import fse from "fs-extra"
|
||||
import yauzl from "yauzl";
|
||||
import got from "got";
|
||||
import env from "dotenv"
|
||||
import { MultiBar } from "cli-progress";
|
||||
import {URL, fileURLToPath } from "node:url";
|
||||
import { LOGGER } from "./logger.js";
|
||||
|
||||
export async function readzipentry(zipfile: yauzl.ZipFile, entry: yauzl.Entry):Promise<string|Buffer> {
|
||||
@@ -119,4 +121,19 @@ export async function xfastdownload(
|
||||
concurrency: concurrency,
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export const usemirror = (()=>{
|
||||
env.config()
|
||||
const mirror = process.env.MIRROR
|
||||
if(mirror){
|
||||
return false
|
||||
}else{
|
||||
return true
|
||||
}
|
||||
})()
|
||||
|
||||
export const isDevelopment = (()=>{
|
||||
env.config()
|
||||
return process.env.DEVELOPMENT
|
||||
})()
|
||||
Reference in New Issue
Block a user