https://github.com/austinsonger/dependency-management-
https://github.com/austinsonger/dependency-management-
Last synced: 7 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/austinsonger/dependency-management-
- Owner: austinsonger
- Created: 2023-12-15T21:40:55.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-15T21:46:13.000Z (almost 2 years ago)
- Last Synced: 2025-01-21T23:31:36.400Z (9 months ago)
- Language: Shell
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Dependency Management Script
This script provides a robust solution for managing software dependencies in your projects. It ensures that all necessary tools are available and meet the specified version requirements. With features for handling both mandatory and optional dependencies, as well as support for debugging and execution control, this script is an essential tool for any software development workflow.
## Features
- **Dependency Verification**: Checks if the required tools are installed with the correct versions.
- **Optional Dependencies**: Handles optional tools gracefully, allowing the script to proceed even if some non-critical tools are missing.
- **Debugging Support**: Includes a debug mode for detailed execution logs.
- **Execution Control**: Ability to execute fallback commands for missing dependencies or incorrect versions.
- **Comprehensive Logging**: Provides detailed information about the dependency checking process.## Getting Started
### Prerequisites
- Bash shell environment.
- Access to standard Unix command-line tools (`sed`, `command`, etc.).### Installation
1. Clone the repository or download the script to your project directory.
2. Ensure that the script is executable:
```
chmod +x dependency_script.sh
```
3. Modify the script to include your specific dependencies and any other customizations you require.### Usage
To use the script in your project:
1. Source the script in your Bash scripts where dependency checking is required:
```bash
source /path/to/dependency_script.sh
```
2. Call the `dependency` function with the required parameters to check each tool. For example:
```bash
dependency "node" "v12.*" "sudo apt install nodejs"
```
3. Optionally, use the `optional` function for non-critical dependencies.## Functions
- `dependency [fallback_command] [version_flag]`: Main function to check for a mandatory dependency.
- `optional [fallback_command] [version_flag]`: Function to check for an optional dependency.
- Additional utility functions for internal use.## Customization
You can customize the script by defining your own dependencies and modifying helper functions to suit your specific requirements.
## Contributing
Contributions to improve the script or extend its functionality are welcome. Please submit a pull request or open an issue to discuss your ideas.
## License
This script is open-source and free to use. Refer to the LICENSE file for more details.