5 changed files with 83 additions and 61 deletions
@ -0,0 +1,38 @@ |
|||||
|
# Bash Tips |
||||
|
|
||||
|
## prevent last false |
||||
|
|
||||
|
function body should not end up with a ternary statement |
||||
|
|
||||
|
### wrong last |
||||
|
|
||||
|
Compound of 2 'false' statement returns false. |
||||
|
|
||||
|
```bash |
||||
|
[[ : ]] && [[ : ]] |
||||
|
``` |
||||
|
|
||||
|
### right last |
||||
|
|
||||
|
```bash |
||||
|
[[ : ]] && [[ : ]] || true |
||||
|
``` |
||||
|
|
||||
|
## arithmetic issue |
||||
|
|
||||
|
last (++) statement does not complete successfully! |
||||
|
|
||||
|
### wrong ++ |
||||
|
|
||||
|
```bash |
||||
|
count=0 |
||||
|
(( ++count )) # ok |
||||
|
(( ++count )) # last statement in function returns false |
||||
|
``` |
||||
|
|
||||
|
### right ++ |
||||
|
|
||||
|
```bash |
||||
|
count=0 |
||||
|
count=$((count+1)) |
||||
|
` |
||||
@ -0,0 +1,8 @@ |
|||||
|
# development mode (credentials required) |
||||
|
|
||||
|
* REAL_DIR=/opt/miaou-bash |
||||
|
* sudo mkdir -m 755 $REAL_DIR && sudo chown $(id -un) $REAL_DIR |
||||
|
* git clone <git@artcode.re>:miaou/miaou-bash.git $REAL_DIR |
||||
|
* DEV_DIR=$HOME/DEV/BASH/miaou-bash # change DEST according to your needs! |
||||
|
* ln -s $REAL_DIR $DEV_DIR |
||||
|
* cd $REAL_DIR && sudo ./install.sh |
||||
@ -0,0 +1,5 @@ |
|||||
|
# TODO |
||||
|
|
||||
|
* [ ] prompt git shows version with `+` when there is more than one commit over current version. ie: v0.0.0 + 2 commits more should display v-1.0.0+ |
||||
|
* [ ] semver_git_tag should append `RELEASE_NOTES.md` from this TODO markdown file, providing that NEW NOTE section below contains appropriate items to fulfill the current release note |
||||
|
* [ ] git log <LATEST_TAG>..HEAD --oneline |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue