{"id":24515503,"url":"https://github.com/mbekkomo/bash-source","last_synced_at":"2025-03-15T10:40:18.701Z","repository":{"id":167473950,"uuid":"643066363","full_name":"mbekkomo/bash-source","owner":"mbekkomo","description":"Improve Bash's `source` into more modular system.","archived":false,"fork":false,"pushed_at":"2023-05-23T21:05:53.000Z","size":2768,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-22T01:17:54.640Z","etag":null,"topics":["bash","bash-script","module-system"],"latest_commit_sha":null,"homepage":"https://urnightmaree.github.io/bash-source/","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mbekkomo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-05-20T02:27:50.000Z","updated_at":"2023-05-20T06:00:35.000Z","dependencies_parsed_at":"2023-12-06T11:14:38.914Z","dependency_job_id":"97eb78cb-7c33-47c9-a955-149409b87fb0","html_url":"https://github.com/mbekkomo/bash-source","commit_stats":null,"previous_names":["urnightmaree/bash-source","komodcat/bash-source","komothecat/bash-source","cattokomo/bash-source","mbekkomo/bash-source"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbekkomo%2Fbash-source","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbekkomo%2Fbash-source/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbekkomo%2Fbash-source/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbekkomo%2Fbash-source/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mbekkomo","download_url":"https://codeload.github.com/mbekkomo/bash-source/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243719373,"owners_count":20336596,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","bash-script","module-system"],"created_at":"2025-01-22T01:18:01.495Z","updated_at":"2025-03-15T10:40:18.677Z","avatar_url":"https://github.com/mbekkomo.png","language":"Shell","readme":"# bash-source\nImprove Bash's `source` into more modular system.\n\n## Why?\nBash's module system is so limited yet confusing, so I made this to cover Bash's module system problems by adding features that is already available in modern languages' module system.\n\nHow to use it?, it's very simple. Imagine that you have a `module.sh` in other directory, but you don't want to hardcode and type long path just to source it. This script helps you with that.\n\n```bash\n# /path/to/dir/module.sh\n\nmod() {\n    echo \"Hello world!\"\n}\n\nMOD=\"Hi Mom!\"\n```\n```bash\n# /path/to/main.sh\n\nsource source.sh # patch `source` and `.`\n\n# SOURCE_PATH is an array containing paths where script/package\n# will be find\nSOURCE_PATH+=(\"/path/to/dir/%s\")\n\nsource module.sh # loaded!\n\nmod\necho \"$MOD\"\n```\n```bash\n# output\nHello World!\nHi Mom!\n```\n\n## Features\n  - Custom path search and path searcher.\n  - Compatible with built-in `source`.\n  - Easy-to-setup inside new projects or already projects.\n\n## Installation\nDrop [source.sh](/source.sh) into your project and source it.\n```bash\nsource source.sh\n```\n\nYou can also patch to it to all Bash script by setting up `BASH_ENV` environment variable into the path where [source.sh](/source.sh) is placed, no need to source it again.\n```bash\nexport BASH_ENV=\"/path/to/source.sh\"\n```\n\nTo verify if it's working, put `source` into your script. The output should be like this.\n```\nsource: error: script name is required\n```\n\n## License\n\nbash-source is licensed under MIT license, see [LICENSE](/LICENSE) for more details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbekkomo%2Fbash-source","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmbekkomo%2Fbash-source","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbekkomo%2Fbash-source/lists"}