garrettjoecox / scriptserver

A Minecraft server wrapper, allows for simple plugins in vanilla
GNU General Public License v3.0
68 stars 10 forks source link

Feature Request: Add directory option in core #22

Closed Dylankjy closed 6 years ago

Dylankjy commented 6 years ago

I would like to request a feature that allows the server to be run in a directory. For example:

const server = new ScriptServer({
    core: {
        jar: serverJar,
        args: ['-Xmx10G'],
        dir: './minecraft/'
    }
});

and it would output all the server files in that directory.

garrettjoecox commented 6 years ago

Hey there,

I haven't tested this, but it should be possible via passing in a directory in the core.spawnOpts.cwd. I will test this when I get home, and then close the issue if I don't run into problems.

Dylankjy commented 6 years ago

How do I do that? Could you provide a code example? Thanks!

ImBaedin commented 6 years ago

I believe he means

const server = new ScriptServer({
    core: {
        jar: serverJar,
        args: ['-Xmx10G'],
        dir: './minecraft/'
        spawnOpts: {
             cwd: 'directory/path/here'
        }
    }
});
garrettjoecox commented 6 years ago

@ImBaedin yep, thanks.

@EnDylan Just tried this out and it works fine. Let me know if you run into any further issues.