From b61bcab7069bd85c89d39b5304c2b8ace1e01ca1 Mon Sep 17 00:00:00 2001 From: Jones Date: Mon, 8 Aug 2022 16:47:47 -0500 Subject: [PATCH] new : pass generator, get latest branch, improve assistant words --- assistant.sh | 8 ++++---- commands/latest_branch.sh | 3 +++ commands/pass_gen.sh | 1 + 3 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 commands/latest_branch.sh create mode 100644 commands/pass_gen.sh diff --git a/assistant.sh b/assistant.sh index c6fefca..9687b08 100755 --- a/assistant.sh +++ b/assistant.sh @@ -6,18 +6,18 @@ assistant_home=$(dirname "$assistant_real_location"); export ASSISTANT_LOCATION=$assistant_real_location export ASSISTANT_HOME=$assistant_home +echo "Hi sr, I am $assistant_name" + if [ -s $assistant_home/variables ] then export $(cat $assistant_home/variables | xargs) else - echo "variables are empty sr. Don't forget to create it if you want to centralize some variables like folder locations, global users, etc" + echo "Sr. don't forget to create it if you want to centralize some variables like folder locations, global users, etc in this file $assistant_real_location/variables" fi -echo "Hi sr, I am $assistant_name" - if [[ "$1" == "" ]]; then - echo "What Can I do for you? Tell me a command..." + echo "You don't enter a command. What Can I do for you?" else command_path=$assistant_home/private_commands/$1".sh" diff --git a/commands/latest_branch.sh b/commands/latest_branch.sh new file mode 100644 index 0000000..db1c522 --- /dev/null +++ b/commands/latest_branch.sh @@ -0,0 +1,3 @@ +git fetch +latest_branch=$(git for-each-ref --sort=-committerdate | head -n 1 | awk -F '/' '{ print $NF }') +echo "latest_branch: $latest_branch" \ No newline at end of file diff --git a/commands/pass_gen.sh b/commands/pass_gen.sh new file mode 100644 index 0000000..5b9dfb3 --- /dev/null +++ b/commands/pass_gen.sh @@ -0,0 +1 @@ +date +%s | sha256sum | base64 | head -c $1 ; echo \ No newline at end of file