Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename autocommit() with commit_suggestion(), short cs() #64

Merged
merged 1 commit into from
May 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .bl_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
45 changes: 33 additions & 12 deletions bashlava.sh
Original file line number Diff line number Diff line change
@@ -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 💪
Expand All @@ -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
Expand Down Expand Up @@ -129,7 +138,7 @@ works but not clean, but it works mdv() / Show_Docs
0o0o dummy
- dummy

// COMMENT BLOCK //
// COMMENT BLOCK END //
'

### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
Expand Down Expand Up @@ -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_
Expand Down
2 changes: 1 addition & 1 deletion components/alias.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" ; }

Expand Down
54 changes: 0 additions & 54 deletions components/utilities.sh
Original file line number Diff line number Diff line change
@@ -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"
}
Expand Down
1 change: 1 addition & 0 deletions docs/help.md
Original file line number Diff line number Diff line change
Expand Up @@ -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_
Expand Down