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

Occurence of number - NixOs #2

Open
WolfyzDBois opened this issue Nov 19, 2024 · 1 comment
Open

Occurence of number - NixOs #2

WolfyzDBois opened this issue Nov 19, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@WolfyzDBois
Copy link
Member

WolfyzDBois commented Nov 19, 2024

archi
bash: 10#1:0001 + 1: syntax error in expression (error token is ":0001 + 1")
 push
bash: 10#1:0001 + 1: syntax error in expression (error token is ":0001 + 1")
bash: 10#1:0001 + 1: syntax error in expression (error token is ":0001 + 1")
bash: syntax error near unexpected token `('

In NixOs prepa
Note : Archi tag was mannually add (achi-0001), and push with command

@WolfyzDBois WolfyzDBois added the bug Something isn't working label Nov 19, 2024
@WolfyzDBois WolfyzDBois self-assigned this Nov 19, 2024
@WolfyzDBois WolfyzDBois changed the title Archi tag Occurence of nunber - NixOs Nov 19, 2024
@WolfyzDBois
Copy link
Member Author

function push() {
 36     if ! git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
 37         echo -e "\033[0;31mError: This command must be executed in     a Git repository.\033[0m"
 38         return 1
 39     fi
 40
 41     last_push_num=$(git log --oneline | grep -Eo 'push-[0-9]{4}' |     grep -Eo '[0-9]{4}' | sort -n | tail -1)
 42     if [ -z "$last_push_num" ]; then
 43         next_push_num=1
 44     else
 45         next_push_num=$((10#$last_push_num + 1))
 46     fi
 47
 48     new_message=$(printf "push-%04d" "$next_push_num")
 49
 50     if ! git add -A; then
 51         echo -e "\033[0;31mError: Failed to add files with git add    .\033[0m"
 52         return 1
 53     fi
 54
 55     if ! git commit -m "$new_message"; then
 56         echo -e "\033[0;31mError: Failed to create commit.\033[0m"
 57         return 1
 58     fi
 59
 60     if ! git push; then
 61         echo -e "\033[0;31mError: Push to remote repository failed    .\033[0m"
 62         return 1
 63     fi
 64
 65    echo -e "\033[0;32mSuccess: Commit '$new_message' created and p    ushed successfully.\033[0m"
 66 }
 67
 68 function archi() {
 69     if ! git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
 70         echo -e "\033[0;31mError: This command must be executed in     a Git repository.\033[0m"
 71         return 1
```bash

@WolfyzDBois WolfyzDBois changed the title Occurence of nunber - NixOs Occurence of number - NixOs Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant