Comments (6)
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.
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.
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.
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.
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.
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)
- Single Color Scheme HOT 1
- Update doesn't find git executable HOT 21
- update doesn't respect shell environment
- "inject -s" syntax doesn't match "build -s" syntax HOT 5
- Correct Readme HOT 3
- Update to base16 0.9.1 HOT 8
- pybase16 update prompts for Github credentials HOT 4
- distinguish between missing templates and schemes HOT 2
- Python <3.6 compatibility HOT 4
- PyPI Request: Update HOT 1
- Licensing Question HOT 1
- If a template doesn't provide a file extension the output file names have None appended HOT 1
- Failed to Update HOT 3
- Bad characters \u2026
- Workflow: How to ? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from base16-builder-python.