funny-repo/manifests/lethal-company.manifest

68 lines
1.9 KiB
Plaintext

global._ = {
pack_id: "lethal_company",
version: "0.40",
author: "Zeekerss",
name: "Lethal Company",
description: "The Company store has many useful tools for the job, including lights, shovels, walkie talkies, stun grenades, or boomboxes. Things get dangerous at night.",
icon: "https://media.moddb.com/images/downloads/1/261/260757/sddefault.jpg",
bundles: {
"win32-x64": {
url: "https://b2-cdn.ragestudio.net/file/bundler-sg/bundles/lethal-company/bundles/v40/bnd-2-win32-x64.zip",
filename: "bundle.zip",
},
}
}
module.exports = {
id: global._.pack_id,
version: global._.version,
icon: global._.icon,
name: global._.name,
description: global._.description,
author: global._.author,
executable: true,
init: ({ pack_dir, tmp_dir, os_string }) => {
// check if bundle is available for this os
if (typeof global._.bundles[os_string] === "undefined") {
throw new Error(`OS Not supported: ${os_string}`)
}
const dlBundle = global._.bundles[os_string]
const dlObject = {
path: dlBundle.filename,
url: dlBundle.url,
extract: true,
delete_after_extract: true,
progress: true,
}
const data = {
install_steps: {
http_downloads: [
dlObject
]
},
update_steps: {
http_downloads: [
dlObject
]
},
}
return data
},
after_install: async ({pack_dir}) => {
const path = require("node:path")
const fs = require("node:fs")
const runwinBat = path.resolve(pack_dir, "runwin.bat")
await fs.writeFileSync(runwinBat, `"${pack_dir}\\Lethal Company.exe"`, { encoding: 'utf8' })
return true
},
execute: `%install_path%\\runwin.bat`
}