Skip to content
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

refactor (Makefile): error handling and help target #35

Merged
merged 1 commit into from
May 17, 2024

Conversation

pythoninthegrass
Copy link
Contributor

When running the Makefile as-is it fails on the install target if the directory doesn't exist and runs all targets. This PR adds error handling and a new help target/goal that prints available options (ignores short options however).

Description

  • chmod +x
  • shebang
  • default goal is now the help target
  • mark targets as phony (avoid filename collisions)
  • error handling for install target
  • raise issue in todo for deprecated shellcheck call
  • help comments
  • help target (make / make help)
  • exclude requirements.txt (generated by Makefile)

Screenshot 2024-05-15 at 9 07 03 PM

Type of changes

Checklist

  • All new and existing tests pass.
  • Any added/updated scripts added use #!/usr/bin/env interpreter instead of potentially platform-specific direct paths (#!/bin/sh and #!/bin/bash are allowed exceptions)
  • Added/updated scripts are marked executable
  • Scripts do not have a language file extension unless they are meant to be sourced and not run standalone. No end-user should have to know if a script was written in bash, python, ruby or whatever. Not including file extensions makes it easier to rewrite the script in another language later without having to change every reference to the previous version.
  • I have confirmed that the link(s) in my PR are valid.

License Acceptance

  • This repository is Apache version 2.0 licensed (some scripts may have alternate licensing inline in their code) and by making this PR, I am contributing my changes to the repository under the terms of the Apache 2 license.

- chmod +x
- shebang
- default goal is now the help target
- mark targets as phony (avoid filename collisions)
- error handling for install target
- raise issue in todo for deprecated shellcheck call
- help comments
- help target (`make` / `make help`)
- exclude requirements.txt (generated by Makefile)
@pythoninthegrass
Copy link
Contributor Author

re: #!/usr/bin/env interpreter haven't tested extensively, but make exists in /usr/bin/make on macOS and Ubuntu 20.04. Probably the same in Debian and Red Hat family OSes.

Copy link
Owner

@unixorn unixorn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this is a big improvement.

@unixorn unixorn merged commit 6d53d66 into unixorn:main May 17, 2024
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants