{"id":17348243,"url":"https://github.com/diogocavilha/respect-shell","last_synced_at":"2025-04-14T20:57:33.253Z","repository":{"id":107433945,"uuid":"81008597","full_name":"diogocavilha/respect-shell","owner":"diogocavilha","description":"A simple shell module for helping you to write better scripts. With this little module you can use some functions that allow you to showing cool messages and performing some verifications as simple as it should be.","archived":false,"fork":false,"pushed_at":"2021-09-06T15:06:37.000Z","size":184,"stargazers_count":18,"open_issues_count":0,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-28T09:11:16.575Z","etag":null,"topics":["bash","bash-hacks","bash-script","bash-scripting","linux","linux-shell","linux-terminal","shell","shell-script","shell-scripting","shell-scripts","shellcode","shellscript"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/diogocavilha.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,"publiccode":null,"codemeta":null}},"created_at":"2017-02-05T17:24:25.000Z","updated_at":"2024-01-17T19:15:56.000Z","dependencies_parsed_at":"2023-07-26T18:01:18.692Z","dependency_job_id":null,"html_url":"https://github.com/diogocavilha/respect-shell","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diogocavilha%2Frespect-shell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diogocavilha%2Frespect-shell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diogocavilha%2Frespect-shell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diogocavilha%2Frespect-shell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/diogocavilha","download_url":"https://codeload.github.com/diogocavilha/respect-shell/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248961186,"owners_count":21189991,"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-hacks","bash-script","bash-scripting","linux","linux-shell","linux-terminal","shell","shell-script","shell-scripting","shell-scripts","shellcode","shellscript"],"created_at":"2024-10-15T16:51:42.172Z","updated_at":"2025-04-14T20:57:33.224Z","avatar_url":"https://github.com/diogocavilha.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cbr\u003e\n    \u003cimg src=\"https://github.com/diogocavilha/respect-shell/blob/master/images/respect-shell.png\" /\u003e\n  \u003cbr\u003e\n\u003c/p\u003e\n\n[![Shell Check](https://github.com/diogocavilha/respect-shell/workflows/Code%20Style%20Check/badge.svg)](https://github.com/diogocavilha/respect-shell/actions)\n\nA simple shell module for helping you to write better scripts.\nWith this little module you can use some functions that allow you to showing cool messages and performing some verifications as simple as it should be.\n\nWhat is possible to do once you're using **Respect Shell**?  \nTake a look at some features it has by now.\n\n- Messages\n    - [Simple](https://github.com/diogocavilha/respect-shell#respectmessage)\n    - [Red](https://github.com/diogocavilha/respect-shell#respectmessagered)\n    - [Green](https://github.com/diogocavilha/respect-shell#respectmessagegreen)\n    - [Blue](https://github.com/diogocavilha/respect-shell#respectmessageblue)\n    - [Yellow](https://github.com/diogocavilha/respect-shell#respectmessageyellow)\n- Warnings\n    - [Error](https://github.com/diogocavilha/respect-shell#respectmessageerror)\n    - [Success](https://github.com/diogocavilha/respect-shell#respectmessagesuccess)\n    - [Info](https://github.com/diogocavilha/respect-shell#respectmessageinfo)\n    - [Warning](https://github.com/diogocavilha/respect-shell#respectmessagewarning)\n- Processes\n    - [Process](https://github.com/diogocavilha/respect-shell#respectprocess)\n    - [Prepend Process](https://github.com/diogocavilha/respect-shell#respectprependprocess)\n- Labels\n    - [Label](https://github.com/diogocavilha/respect-shell#respectlabel)\n    - [Labels in a row](https://github.com/diogocavilha/respect-shell#respectlabelln)\n- Functions\n    - [Window Title](https://github.com/diogocavilha/respect-shell#respectwindowtitle)\n    - [Title](https://github.com/diogocavilha/respect-shell#respecttitle)\n    - [File exists](https://github.com/diogocavilha/respect-shell#respectfile_exists)\n    - [Directory exists](https://github.com/diogocavilha/respect-shell#respectdir_exists)\n    - [Root is required](https://github.com/diogocavilha/respect-shell#respectroot_is_required)\n    - [Question Yes No](https://github.com/diogocavilha/respect-shell#respectquestionyesno)\n\n---\n\n# How to use it?\n\nYou can just git clone this repo and link `respect.sh` in your shellscript file, like:\n\n`my_file.sh`\n```bash\n#!/bin/bash\n\n. /path/to/respect.sh\n\n# You are good to go now.\n```\n\n# Features\n\n## respect.message\n\n```bash\nrespect.message \"param1\"\n```\n\n- `param1` Message\n\n**Sample:**\n\n```bash\n#!/bin/bash\n\n. /path/to/respect.sh\n\nrespect.message \"Normal message\"\n```\n\n![respect.message](https://github.com/diogocavilha/respect-shell/blob/master/screenshots/respect-message.png)\n\n## respect.message.red\n\n```bash\nrespect.message.red \"param1\"\n```\n\n- `param1` Message\n\n**Sample:**\n\n```bash\n#!/bin/bash\n\n. /path/to/respect.sh\n\nrespect.message.red \"Red message\"\n```\n\n![respect.message.red](https://github.com/diogocavilha/respect-shell/blob/master/screenshots/respect-message-red.png)\n\n## respect.message.green\n\n```bash\nrespect.message.green \"param1\"\n```\n\n- `param1` Message\n\n**Sample:**\n\n```bash\n#!/bin/bash\n\n. /path/to/respect.sh\n\nrespect.message.green \"Green message\"\n```\n\n![respect.message.green](https://github.com/diogocavilha/respect-shell/blob/master/screenshots/respect-message-green.png)\n\n## respect.message.blue\n\n```bash\nrespect.message.blue \"param1\"\n```\n\n- `param1` Message\n\n**Sample:**\n\n```bash\n#!/bin/bash\n\n. /path/to/respect.sh\n\nrespect.message.blue \"Blue message\"\n```\n\n![respect.message.blue](https://github.com/diogocavilha/respect-shell/blob/master/screenshots/respect-message-blue.png)\n\n## respect.message.yellow\n\n```bash\nrespect.message.yellow \"param1\"\n````\n\n- `param1` Message\n\n**Sample:**\n\n```bash\n#!/bin/bash\n\n. /path/to/respect.sh\n\nrespect.message.yellow \"Yellow message\"\n```\n\n![respect.message.yellow](https://github.com/diogocavilha/respect-shell/blob/master/screenshots/respect-message-yellow.png)\n\n## respect.message.error\n\n```bash\nrespect.message.error \"param1\"\n```\n\n- `param1` Message\n\n**Sample:**\n\n```bash\n#!/bin/bash\n\n. /path/to/respect.sh\n\nrespect.message.error \"Error\"\n```\n\n![respect.message.error](https://github.com/diogocavilha/respect-shell/blob/master/screenshots/respect-message-error.png)\n\n## respect.message.success\n\n```bash\nrespect.message.success \"param1\"\n```\n\n- `param1` Message\n\n**Sample:**\n\n```bash\n#!/bin/bash\n\n. /path/to/respect.sh\n\nrespect.message.success \"Success\"\n```\n\n![respect.message.success](https://github.com/diogocavilha/respect-shell/blob/master/screenshots/respect-message-success.png)\n\n## respect.message.info\n\n```bash\nrespect.message.info \"param1\"\n```\n\n- `param1` Message\n\n**Sample:**\n\n```bash\n#!/bin/bash\n\n. /path/to/respect.sh\n\nrespect.message.info \"Info\"\n```\n\n![respect.message.info](https://github.com/diogocavilha/respect-shell/blob/master/screenshots/respect-message-info.png)\n\n## respect.message.warning\n\n```bash\nrespect.message.warning \"param1\"\n```\n\n- `param1` Message\n\n**Sample:**\n\n```bash\n#!/bin/bash\n\n. /path/to/respect.sh\n\nrespect.message.warning \"Warning\"\n```\n\n![respect.message.warning](https://github.com/diogocavilha/respect-shell/blob/master/screenshots/respect-message-warning.png)\n\n## respect.title\n\n```bash\nrespect.title \"param1\"\n```\n\n- `param1` Title\n\n**Sample:**\n\n```bash\n#!/bin/bash\n\n. /path/to/respect.sh\n\nrespect.title \"Title\"\n```\n\n![respect.title](https://github.com/diogocavilha/respect-shell/blob/master/screenshots/respect-title.png)\n\n## respect.process\n\n```bash\nrespect.process \"param1\" \"param2\"\n```\n\n- `param1` Process label\n- `param2` Callback\n\n\u003e The callback might be a function you've written\n\n**Sample:**\n\nIf the callback execution is succeeded (it returns `0`).\n\n```bash\n#!/bin/bash\n\n. /path/to/respect.sh\n\nrespect.process \"Processing something...\\t\" \"callback\"\n```\n\n![respect.process](https://github.com/diogocavilha/respect-shell/blob/master/screenshots/respect-process-ok.png)\n\n\u003e P.S: A succeeded callback execution returns `0`. That's a shellscript rule: `0` = true, `1` = false.\n\u003e That's a little weird, I know that, but that's how it is, accept it.\n\nIf the callback execution fails (it returns `1`).\n\n```bash\n#!/bin/bash\n\n. /path/to/respect.sh\n\nrespect.process \"Processing something...\\t\" \"callback\"\n```\n\n![respect.process](https://github.com/diogocavilha/respect-shell/blob/master/screenshots/respect-process-fail.png)\n\n## respect.prepend.process\n\n```bash\nrespect.prepend.process \"param1\" \"param2\"\n```\n\n- `param1` Process label\n- `param2` Callback\n\n\u003e The the callback might be a function you've written\n\n**Sample:**\n\nIf the callback execution is succeeded (it returns `0`).\n\n```bash\n#!/bin/bash\n\n. /path/to/respect.sh\n\nrespect.prepend.process \"Processing something\" \"callback\"\n```\n\n![respect.prepend.process](https://github.com/diogocavilha/respect-shell/blob/master/screenshots/respect-prepend-process-ok.png)\n\nIf the callback execution fails (it returns `1`).\n\n```bash\n#!/bin/bash\n\n. /path/to/respect.sh\n\nrespect.prepend.process \"Processing something\" \"callback\"\n```\n\n![respect.prepend.process](https://github.com/diogocavilha/respect-shell/blob/master/screenshots/respect-prepend-process-fail.png)\n\n## respect.label\n\n```bash\nrespect.label \"param1\" \"param2\"\n```\n\n- `param1` Label\n- `param2` Value\n\n**Sample:**\n\n```bash\n#!/bin/bash\n\n. /path/to/respect.sh\n\nrespect.label \"Label 1\" \"Value 1\"\nrespect.label \"Label 2\" \"Value 2\"\nrespect.label \"Label 3\" \"Value 3\"\n```\n\n![respect.label](https://github.com/diogocavilha/respect-shell/blob/master/screenshots/respect-label.png)\n\n## respect.label.ln\n\n```bash\nrespect.label.ln \"param1\" \"param2\"\n```\n\n- `param1` Label\n- `param2` Value\n\n**Sample:**\n\n```bash\n#!/bin/bash\n\n. /path/to/respect.sh\n\nrespect.label.ln \"Label line 1\" \"Value 1\"\nrespect.label.ln \"\\tLabel line 2\" \"Value 2\"\nrespect.label.ln \"\\tLabel line 3\" \"Value 3\"\n```\n\n![respect.label.ln](https://github.com/diogocavilha/respect-shell/blob/master/screenshots/respect-label-ln.png)\n\n## respect.root_is_required\n\n```bash\nrespect.root_is_required \"param1\"\n```\n\n- `param1` (Optional) Message\n\n**Sample:**\n\n```bash\n#!/bin/bash\n\n. /path/to/respect.sh\n\nrespect.root_is_required\n```\n\n![respect.root_is_required](https://github.com/diogocavilha/respect-shell/blob/master/screenshots/respect-root-is-required.png)\n\n## respect.dir_exists\n\n```bash\nrespect.dir_exists \"param1\"\n```\n\n- `param1` path\n\n**Sample:**\n\n```bash\n#!/bin/bash\n\n. /path/to/respect.sh\n\nif respect.dir_exists \"/path/to/directory\"\nthen\n    # code ...\nfi\n```\n\n## respect.file_exists\n\n```bash\nrespect.file_exists \"param1\"\n```\n\n- `param1` path\n\n**Sample:**\n\n```bash\n#!/bin/bash\n\n. /path/to/respect.sh\n\nif respect.file_exists \"/path/to/file\"\nthen\n    # code ...\nfi\n```\n\n## respect.window.title\n\n```bash\nrespect.window.title \"param1\"\n```\n\n- `param1` Window title\n\n**Sample:**\n\n```bash\n#!/bin/bash\n\n. /path/to/respect.sh\n\nrespect.window.title \"This is the window title\"\n```\n\n## respect.question.yesno\n\n```bash\nrespect.question.yesno \"param1\" \"param2\"\n```\n\n- `param1` Question string.\n- `param2` (Optional) Default answer. It could be `y` or `n`. If not present, the default answer is `n`.\n\n**Sample:**\n\n```bash\n#!/bin/bash\n\n. /path/to/respect.sh\n\nif respect.question.yesno \"Would you like to proceed?\" \"y\"\nthen\n    # code ...\nfi\n```\n\n**Outputs**\n\n**Yes** as default.\n\n```bash\nrespect.question.yesno \"Would you like to proceed?\" \"y\"\n\n# Would you like to proceed? [Y/n]: \n```\n\n**No** as default\n\n```bash\nrespect.question.yesno \"Would you like to proceed?\" \"n\"\n\n# Would you like to proceed? [y/N]: \n```\n\n**No** as default\n\n```bash\nrespect.question.yesno \"Would you like to proceed?\"\n\n# Would you like to proceed? [y/N]: \n```\n\n# Contributing :rocket:\n\n- Give this project a star :star:\n- Fork the project.\n- Create a branch. (`git checkout -b your-branch-name`).\n- Make your changes on the branch you've just created.\n- Commit it.\n- Push it.\n- Send your Pull Request.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiogocavilha%2Frespect-shell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiogocavilha%2Frespect-shell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiogocavilha%2Frespect-shell/lists"}