From e9ecc9a157dc437b1dba36bcf782fb3f6489d8f0 Mon Sep 17 00:00:00 2001 From: Pascal Andy Date: Wed, 24 May 2023 13:33:46 -0400 Subject: [PATCH] Rename autocommit() with commit_suggestion(), short cs() --- .bl_env.sh | 3 --- bashlava.sh | 45 +++++++++++++++++++++++++--------- components/alias.sh | 2 +- components/utilities.sh | 54 ----------------------------------------- docs/help.md | 1 + 5 files changed, 35 insertions(+), 70 deletions(-) diff --git a/.bl_env.sh b/.bl_env.sh index 883ead1..d4b622a 100644 --- a/.bl_env.sh +++ b/.bl_env.sh @@ -41,9 +41,6 @@ CFG_LOCK_INIT="false" DOCKER_IMG_FIGLET="devmtl/figlet:1.0" DOCKER_IMG_GLOW="devmtl/glow:1.4.1" -### CUSTOM directory path (default) -DIR_DEST_QOBUZ="/Users/unknown" - ### source array. See FLAG 654 # CFG_LIST_OF_REQ_COMPONENTS # CFG_LIST_OF_REQ_MARKDOWN diff --git a/bashlava.sh b/bashlava.sh index 34d4ea1..80e456f 100755 --- a/bashlava.sh +++ b/bashlava.sh @@ -1,8 +1,8 @@ #!/usr/bin/env bash : ' -// COMMENT BLOCK // -TO-DO comment section. Total of 1 +// COMMENT BLOCK START // +TO-DO comment section. PINNED issues on GH #4 TO-DO & backlog 💪 @@ -26,11 +26,20 @@ ________________________________________________________________________________ PRIORITY 1 ____________________________________________________________________________ TODO -Test the flow with tags ... +Rename autocommit() with commit_suggestion() TODO when checking if Docker is running, lets open it `open -a docker` if its not running instead of showing a message to open it. +TODO +tag ... Im sure that is a way to bypass the prompt step + +TODO +When release(), lets open the page : https://github.com/firepress-org/bashlava/releases + +TODO +FEAT: Qobuz ... je me questionne si je le gere dans bashlava ou ailleurs. + TODO Faire une liste rapid tde toutes les Fct dans `utilities` le but est de listé toutes mes scripts tel que qobuz, youtube, nas_sync, etc @@ -129,7 +138,7 @@ works but not clean, but it works mdv() / Show_Docs 0o0o dummy - dummy -// COMMENT BLOCK // +// COMMENT BLOCK END // ' ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### # @@ -509,25 +518,37 @@ function ci { # User_ esac } -function autocommit { # User_ +function commit_suggestion { # User_ # https://github.com/firepress-org/bashlava/pull/62 Condition_Attr_2_Must_Be_Empty _from_fct="d" - _prompt="Based on the output of this 'git status', write a great git commit message that will help me see quickly what this git commit was all about. + _prompt="Based on the output of this 'git status', write me five git commit messages suggestions that will help me see quickly what this git commit was all about. The message must be one line with a maximum of 200 characters. - Dont mention anything about the branch name. - Dont mention anything about 'no changes added to commit'. + Mentions which files are impacted + If you see 'nothing to commit, working tree clean' in the git status output, then reply: 'nothing to commit' + Avoid mentionning anything about the branch name + Avoid mentionning anything 'untracked files' + Avoid mentionning anything about 'no changes added to commit' + Avoid mentionning anything Remove obsolete Here is the git status output: " &&\ _git_status="$(git status)" &&\ - _commit_message=$(echo "${_prompt} ${_git_status}" | chatgpt) && echo &&\ + _commit_message=$(echo "${_prompt} ${_git_status}" | chatgpt) &&\ + + # Remove empty lines using sed + _clean_message=$(echo "$_commit_message" | sed '/^$/d') &&\ + + # Just show what chatGPT would write as our git commit + my_message="Commit Suggestion:" && Print_Blue &&\ + echo "${_clean_message}" + + #git add -A && git commit -m "${_commit_message}" &&\ + #git push &&\ + #log; - git add -A && git commit -m "${_commit_message}" &&\ - git push &&\ - log; } function dummy { # User_ diff --git a/components/alias.sh b/components/alias.sh index b679bf1..e2f98bf 100755 --- a/components/alias.sh +++ b/components/alias.sh @@ -17,7 +17,7 @@ l() { "log" ; } sq() { "squash" ; } s() { "show" ; } sv() { "Show_Version" ; } -d() { "autocommit" ; } +cs() { "commit_suggestion" ; } hash() { "git rev-parse HEAD && git rev-parse --short HEAD" ; } Print_Yellow() { "Print_Warning" ; } diff --git a/components/utilities.sh b/components/utilities.sh index 8342edf..db0a90e 100755 --- a/components/utilities.sh +++ b/components/utilities.sh @@ -1,59 +1,5 @@ #!/usr/bin/env bash -function qobuz { - -# Source the URLs -_file_is="urls_array.sh" _file_path_is="${_path_bashlava}/private/${_file_is}" && Condition_File_Must_Be_Present -source "${_file_path_is}" - -# Check if the urls array is empty -if [ -z "${urls}" ]; then - my_message="The urls array is empty. Exiting." && Print_Red; - exit 1 -fi - -# Show URLs -printf '%s\n' "${urls[@]}" && echo - -# Prompt the user to continue -read -p "Do you want to continue? (y/n) " answer -case ${answer:0:1} in - y|Y ) - echo "Continuing with the following urls?" - ;; - * ) - echo "Exiting." - exit 0 - ;; -esac - -DESTINATION="$DIR_DEST_QOBUZ" -mkdir -p "$DESTINATION" && cd "$DESTINATION" - -# Loop through the URLs and determine the type of URL -for url in "${urls[@]}"; do - if [[ $url =~ /artist/ ]]; then - echo "Downloading artist from $url" - qobuz-dl dl "$url" -q 27 --albums-only --og-cover - elif [[ $url =~ /album/ ]]; then - echo "Downloading album from $url" - qobuz-dl dl "$url" -q 27 --no-db --og-cover - elif [[ $url =~ /playlist/ ]]; then - echo "Downloading playlist from $url" - qobuz-dl dl "$url" -q 27 --no-db --og-cover - else - echo "This URL is not a standard qobuz URL: $url" - fi -done -# END - -# --albums-only -# -q 5 (mp3 320 kbps) -# -q 27 highest quality - -} - - function Utility_passgen { docker run --rm devmtl/alpine:3.11_2020-02-26_08H42s20_dec5798 sh "random7.sh" } diff --git a/docs/help.md b/docs/help.md index 9b3f37c..67e2063 100755 --- a/docs/help.md +++ b/docs/help.md @@ -10,6 +10,7 @@ - `e` ....... | create a branch`edge`from main ........ | _standalone_ - `c` ....... |`commit`................................ | usage: c "This feature rocks" +- `cs` ....... |`commit_suggestion`.................... | _standalone_ suggestions made by chatGPT 3.5 - `sq` ...... |`squash`commits ........................ | usage: sq 3 "Add: feat xyz, issue 123" - `pr` ...... | create`pull request` .................. | _standalone_ - `ci` ...... | show`ci status`on GitHub Actions ...... | _standalone_