{"id":22558018,"url":"https://github.com/jd-apprentice/sh-to-bin-boilerplate","last_synced_at":"2025-03-28T11:28:13.744Z","repository":{"id":228301522,"uuid":"773588676","full_name":"jd-apprentice/sh-to-bin-boilerplate","owner":"jd-apprentice","description":"Create your binary's from shell scripts with shc 🔢","archived":false,"fork":false,"pushed_at":"2024-03-18T04:07:46.000Z","size":37,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-02T12:15:01.771Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/jd-apprentice.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,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-03-18T02:55:16.000Z","updated_at":"2024-05-07T11:08:09.000Z","dependencies_parsed_at":"2024-03-18T05:24:48.598Z","dependency_job_id":"6e9c82a5-1849-4c4e-bf18-8c4cd8ea2f46","html_url":"https://github.com/jd-apprentice/sh-to-bin-boilerplate","commit_stats":null,"previous_names":["jd-apprentice/sh-to-bin-boilerplate"],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jd-apprentice%2Fsh-to-bin-boilerplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jd-apprentice%2Fsh-to-bin-boilerplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jd-apprentice%2Fsh-to-bin-boilerplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jd-apprentice%2Fsh-to-bin-boilerplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jd-apprentice","download_url":"https://codeload.github.com/jd-apprentice/sh-to-bin-boilerplate/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246020222,"owners_count":20710712,"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":[],"created_at":"2024-12-07T20:10:40.003Z","updated_at":"2025-03-28T11:28:13.711Z","avatar_url":"https://github.com/jd-apprentice.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SH TO BIN Boilerplpate 📦\n\n![img](example.png)\n\nThis repository is a boilerplate on how create your own binaries from shell scripts. Using shc, you can compile your shell scripts into binaries.\n\nLogo from `http://www.patorjk.com/software/taag/#p=display\u0026f=ANSI%20Regular\u0026t=Sample%20App`\n\n## Requirements 📋\n\n- [shc](https://github.com/neurobin/shc)\n- bash\n\n## Build 📦\n\nThere is a makefile rule to build the binary.\n\n```bash\nmake\n```\n\n## Execute 🔢\n\nThere is a makefile rule to execute the binary.\n\n```bash\nmake execute\n```\n\nOnce complete you can move the binary to `/usr/local/bin` to make it available system wide.\n\n```bash\nsudo mv build/sample_app /usr/local/bin\n```\n\n## Explanation on how add funcionality ➕\n\nYou can write functions with bash or write node/python scripts and call them from the main script.\n\nTo understand how to make a python or node script callable from the main script, you can check the `weather` and `dolar` functions.\n\nAlso read from `https://en.wikipedia.org/wiki/Shebang_%28Unix%29` to understand how to make a script executable.\n\nTo understand how the select works, you can read from `https://linuxize.com/post/bash-select/`\n\n```bash\nPS3='Select an option: ' \n\n# Add more options here\noptions=(\"Print message\" \"Weather\" \"Dolar\" \"Exit\")\n\n# Add your functions here\nselect opt in \"${options[@]}\"\ndo\n    case $opt in\n        \"Print message\")\n            first\n            break\n            ;;\n        \"Weather\")\n            weather\n            break\n            ;;\n        \"Dolar\")\n            dolar\n            break\n            ;;\n        \"Exit\")\n            stop_app\n            break\n            ;;\n        *) echo -e \"Invalid option\";;\n    esac\ndone\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjd-apprentice%2Fsh-to-bin-boilerplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjd-apprentice%2Fsh-to-bin-boilerplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjd-apprentice%2Fsh-to-bin-boilerplate/lists"}