UNPKG

hackmud-script-manager

Version:

Script manager for game hackmud, with minification, TypeScript support, and player script type definition generation.

12 lines (11 loc) 435 B
import { copyFilePersistent } from "@samual/lib/copyFilePersistent" import { resolve } from "path" async function pull(sourceFolderPath, hackmudPath, script) { const [user, name] = script.split(".") if (!user || !name) throw Error('`script` argument must be in "user.name" format') await copyFilePersistent( resolve(hackmudPath, user, "scripts", name + ".js"), resolve(sourceFolderPath, user, name + ".js") ) } export { pull }