Giter Club home page Giter Club logo

Comments (4)

MrPixelized avatar MrPixelized commented on May 27, 2024 1

Another way of fixing cross-platform compatibility that I considered mentioning in the issue itself is to run the build hooks in a container and mount the whole mcman repository into it. The problem with this approach is that you don't know what someone would want to do. Maybe it's more than just change a couple of files, maybe they want to send a notification to their phone that the build is completed (e.g. if they have extremely slow internet and/or a lot of huge worlds), or whatever other use cases we cannot think of. This "outside the repository" use would need to be facilitated by editing the container specification, and we can't expect everyone who just wants a script to run to be good at working with containers, which are a divisive technology anyway.

from mcman.

TheAlan404 avatar TheAlan404 commented on May 27, 2024

that's a solid config format! i guess we can add extra metadata (such as the world being unpacked) as environment variables to the child process.

im still skeptical about the platform compatability though, bat and sh dont mix very well

maybe it can be like so: hooks/meow.sh and hooks/meow.bat - would be defined as [hooks.meow] in the config and mcman would pick the correct file depending on the OS

from mcman.

MrPixelized avatar MrPixelized commented on May 27, 2024

However, .py scripts would work the same on both. To avoid having to code a million edge cases for incompatible-but-similar programs (e.g. windos binaries, POSIX binaries, MacOS binaries), how about we add the option of manually specifying platform-dependent options?

So if you have a cross-platform script (e.g. .py), or you're not interested in cross-platform compatibility (such as a lot of users), you don't do anything else, but if you are, you just do:

[hooks.meow]
platforms = { windows = "meow.bat", linux = "meow.sh" } # Unmentioned platforms will default to the name specified by the subsection, namely just "meow"

This would mean you could make your configuration as you want (e.g. just call your script "meow" on unix), but if demand falls upon you to fix cross-platform compatibility, it is easy to do (add a meow.bat, and add platforms = { windows = "meow.bat" } to the [hooks.meow] section - NO need to rename the original file, which might already be expected in its previous form by build/test pipelines and such). Forcing people to give their scripts particular names also runs into other edge cases, such as someone wanting to use a .sh file on windows.

An alternative syntax could be something like:

[hooks.meow]
windows = "meow.bat"
linux = "meow.sh"

Once again with the option of leaving any platforms missing and having the default meow script be called.

from mcman.

TheAlan404 avatar TheAlan404 commented on May 27, 2024

It's now implemented, will release 0.4.4 soon! :3

from mcman.

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.