feat:最终成品
This commit is contained in:
@@ -16,9 +16,9 @@ interface Answers {
|
||||
}
|
||||
let unzip_path:string = ""
|
||||
if(isDevelopment){
|
||||
unzip_path = join("./","instance")
|
||||
unzip_path = join("./","instance/")
|
||||
}else{
|
||||
unzip_path = join(getCurrnetDir(),"instance")
|
||||
unzip_path = join(getCurrnetDir().replace("ndist",""),"instance")
|
||||
}
|
||||
let zipnamew: string = ""
|
||||
const argv = process.argv.slice(2)[0];
|
||||
@@ -60,6 +60,7 @@ async function main(modpack_path: string) {
|
||||
zipfile.openReadStream(entry,(err,stream)=>{ //读取overrides文件夹下的所有文件和文件夹
|
||||
const dir = dirname(zipfilex)
|
||||
fse.ensureDirSync(dir);
|
||||
console.log(zipfilex)
|
||||
stream.pipe(fse.createWriteStream(zipfilex))
|
||||
})
|
||||
//console.log(entry.fileName)
|
||||
@@ -67,7 +68,7 @@ async function main(modpack_path: string) {
|
||||
} else {
|
||||
const name: string = entry.fileName;
|
||||
dud_files.push(name);
|
||||
if (name && name.endsWith(".json")) {
|
||||
if (name.endsWith(".json")) {
|
||||
pack_info = JSON.parse(
|
||||
(await readzipentry(zipfile, entry)).toString()
|
||||
);
|
||||
@@ -81,8 +82,8 @@ async function main(modpack_path: string) {
|
||||
const plat = platform(what_platform(dud_files))
|
||||
const info = await plat.getinfo(pack_info);
|
||||
await plat.downloadfile(pack_info,dirx)
|
||||
await install(info.loader,info.minecraft,info.loader_version,dirx)
|
||||
await DeEarthMain(join(dirx,"mods"),join(unzip_path,"rubbish"))
|
||||
await install(info.loader,info.minecraft,info.loader_version,dirx)
|
||||
LOGGER.info("DeEarthX已将服务端制作完成!");
|
||||
zipfile.close();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user