-
-
Notifications
You must be signed in to change notification settings - Fork 120
Add support for media dir environment variable. #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for media dir environment variable. #26
Conversation
README.md
Outdated
| $ git-sim --media-dir=path/to/output status | ||
| ``` | ||
|
|
||
| Optionally, set the environment variable `git_sim_media_dir` to default that as the media directory, if no `--media-dir` is provided. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's update to something like:
Optionally, set the environment variable git_sim_media_dir to set a global default media directory, to be used if no --media-dir is provided. Simulated output images/videos will be placed in this location, in subfolders named with the corresponding repo's name.
README.md
Outdated
| $ export git_sim_media_dir=path/to/media/directory | ||
| $ git-sim status | ||
| ``` | ||
| Note: `--media-dir` takes precedence over the environment variable. If you set the environment and still provide the argument, you'll find the media in the path provided by `--media-dir` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a period at the end of the second sentence.
git_sim/__main__.py
Outdated
| config.verbosity = "ERROR" | ||
|
|
||
| # If the env variable is set and no argument provideed, use the env variable value | ||
| if os.getenv('git_sim_media_dir') is not None and args.media_dir == '.': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can shorten the if statement if we remove the is not None and just use if os.getenv('git_sim_media_dir') and args.media_dir == '.':
git_sim/__main__.py
Outdated
| config.media_dir = os.path.join(os.path.expanduser(args.media_dir), "git-sim_media") | ||
| config.verbosity = "ERROR" | ||
|
|
||
| # If the env variable is set and no argument provideed, use the env variable value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo - "provideed" instead of "provided"
initialcommit-io
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like there are multiple similar commits here in this pull request, can you squash it into just 1? And make the changes I requested in the my comments?
Updated the README to reflect the env variable changes. Signed-off-by: Abhijit Nathwani <abhijit.nathwani@gmail.com>
Signed-off-by: Abhijit Nathwani <abhijit.nathwani@gmail.com>
eee3ef3 to
c932a4e
Compare
|
Thanks for the review! I have updated it as per your comments. |
@initialcommit-io as discussed, I have implemented the changes for setting the environment variable. Let me know if it requires any other updates. I have tested on Windows/Linux. I don't have access to a Macintosh to test it. Can you please verify this once ?
Fixes #4