From 7020d87023efbb383a222e368f4cf95b2e0b10f2 Mon Sep 17 00:00:00 2001 From: Miles Date: Sat, 1 Feb 2025 21:05:21 -0300 Subject: [PATCH] chore: add check condition to run password --- README.md | 2 +- shellPass.sh | 38 ++++++++++++++++++-------------------- 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index c33806b..0b2a242 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # shellPass - Shell Script Password Generator -[![Release](https://img.shields.io/badge/release-3.4.1-brightgreen)](https://github.com/mateuscomh/shellPass/releases) +[![Release](https://img.shields.io/badge/release-3.5.0-brightgreen)](https://github.com/mateuscomh/shellPass/releases) [![Build Status](https://github.com/mateuscomh/shellPass/actions/workflows/super-linter.yml/badge.svg)](https://github.com/mateuscomh/shellPass/actions/workflows/super-linter.yml) ## Overview diff --git a/shellPass.sh b/shellPass.sh index f6a2642..0788410 100755 --- a/shellPass.sh +++ b/shellPass.sh @@ -14,7 +14,7 @@ BOLD=$(tput bold) ITALIC=$(tput dim) main() { - local VERSION="Ver:3.4.1" + local VERSION="Ver:3.5.0" local AUTHOR="Matheus Martins-3mhenrique@gmail.com" local USAGE="Generate random passwords from CLI ███████╗██╗ ██╗███████╗██╗ ██╗ ██████╗ █████╗ ▄▄███▄▄·▄▄███▄▄· @@ -83,25 +83,23 @@ _writeinfile() { } _makePass() { - PASS=$(tr -dc "$CPX" /dev/null ;; - Linux) - if grep -iq Microsoft /proc/version; then - printf "%s" "$PASS" | clip.exe - elif command -v xclip >/dev/null; then - printf "%s" "$PASS" | xclip -sel clip - else - echo "$PASS" - exit 125 - fi - ;; - *) - echo "This is compatible only for GNU/Linux, MacOS or WSL2" - exit 1 - ;; - esac - echo -e "${BOLD}$PASS${FECHA}" + if PASS=$(tr -dc "$CPX" /dev/null ;; + Linux) + if grep -iq Microsoft /proc/version; then + printf "%s" "$PASS" | clip.exe + elif command -v xclip >/dev/null; then + printf "%s" "$PASS" | xclip -sel clip + fi + ;; + *) + echo "This is compatible only for GNU/Linux, MacOS or WSL2" + exit 1 + ;; + esac + fi } #---Main main "$1" "$2"