Coder Social home page Coder Social logo

Comments (11)

mindstorm38 avatar mindstorm38 commented on May 31, 2024

You can! If you use the full library (either from pip install or if you can bundle files from the portablemc directory in the repository). Then you can use

import portablemc.cli
portablemc.cli.main(["argument0", ...])

from portablemc.

GoodDay360 avatar GoodDay360 commented on May 31, 2024

@mindstorm38 can u give me the full example ? For example like: start farbic:1.17.1 jvm-args ...?
The arg is the same as the one using in console ?
I tried: portablemc.cli.main(["start farbic:1.17.1"])
ain't working

from portablemc.

mindstorm38 avatar mindstorm38 commented on May 31, 2024

Arguments are the same but you must separate arguments in the list, in your example this will be

portablemc.cli.main(["start", "fabric:1.17.1"])

from portablemc.

GoodDay360 avatar GoodDay360 commented on May 31, 2024

Thanks, But I can't make the import work. I installed it using pip but still get an error.

from portablemc.

mindstorm38 avatar mindstorm38 commented on May 31, 2024

Hmmm what is the error?

from portablemc.

GoodDay360 avatar GoodDay360 commented on May 31, 2024

Sorry for the late reply(Had school). Here is what the error is. Seem like it can't find the fabric addons.

image

from portablemc.

intact avatar intact commented on May 31, 2024

Try to run portablemc.cli.main(["addon", "list"]) (you probably miss fabric addon).

If you run portablemc.cli.main(["addon", "dirs"]) you can see directories, where portablemc search for addons.

from portablemc.

GoodDay360 avatar GoodDay360 commented on May 31, 2024

C:\Users\Administrator\AppData\Local\portablemc\addons (not existing)
Why it in AppData/Local ?
Anyway is there a way I can change the dirs to custom dir?

from portablemc.

mindstorm38 avatar mindstorm38 commented on May 31, 2024

Hi! Sry for the delay, add-ons can be currently placed in directories given by addon dirs sub command. It's not currently possible to change the add-on directories (excellent idea btw!), for now you can use a directory called addons next to you executable.

from portablemc.

mindstorm38 avatar mindstorm38 commented on May 31, 2024

I can add an environment variable like PMC_ADDONS_DIRS to allow users to add optional add-ons directories as you wish.

from portablemc.

mindstorm38 avatar mindstorm38 commented on May 31, 2024

I close this issue, the PMC_ADDONS_PATH environment variable was added (in 2.0.4) and can solve you issue!

from portablemc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.