Code Monkey home page Code Monkey logo

Comments (6)

InspectorMustache avatar InspectorMustache commented on September 25, 2024

Yes, good point! I changed it so the builder reports warnings and errors to stderr and exits with 1 on fatal and 2 on non-fatal errors. I haven't pushed this to PyPI yet so if you could give the master branch a try and see if it works for you, I would really appreciate it.

from base16-builder-python.

theoratkin avatar theoratkin commented on September 25, 2024

The program indeed reports errors properly now!

Though if a target directory for the build output doesn't have execution permissions, code 2 is returned at the moment. I would consider it a fatal error?

from base16-builder-python.

InspectorMustache avatar InspectorMustache commented on September 25, 2024

Well, I guess that depends on your interpretation of fatal. This happens because the error is encountered in one of the co-routines that each build a single scheme. So while the co-routines all fail, the program that is running them still finishes execution successfully. I guess, we could check whether all co-routines run into an issue and then treat that as a fatal error as opposed to only some of them failing. But then there would also have to be checks whether the problem is an error or just a warning. I don't think more complex error checking just to produce a more transparent exit code is really warranted in this case. I would recommend checking for file access permissions within your script instead.

from base16-builder-python.

theoratkin avatar theoratkin commented on September 25, 2024

The thing is, if a directory doesn't have write permissions the program actually acts correctly. It prints "No write permission for output directory." and exits without even trying to build anything. I think it would make sense to act similarly if a directory doesn't have execution permissions for uniformity's sake.

from base16-builder-python.

InspectorMustache avatar InspectorMustache commented on September 25, 2024

Ooooookay then, so now it'll check for the write and execution bytes. I wasn't aware execution rights were even necessary. Anyway, you shouldn't really rely on these exit codes too much in your scripts since they are not explicit at all.

from base16-builder-python.

theoratkin avatar theoratkin commented on September 25, 2024

Thanks! It returns 1 now if a directory lacks execution permissions, as expected.

Of course, I won't just rely on these codes and will perform other checks in my script if necessary. It's just a nice touch to have this (already great) program act correctly to missing execution permissions.

I appreciate the work you've done. I'm closing this issue now.

from base16-builder-python.

Related Issues (16)

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.