Rework exit codes
This commit is contained in:
parent
dc95d17211
commit
d5ed3d209d
2 changed files with 25 additions and 2 deletions
23
README.md
23
README.md
|
@ -28,6 +28,12 @@ bootstrap file :
|
||||||
dotinstall uninstall bootstrap
|
dotinstall uninstall bootstrap
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Or update with `update` even in git mode
|
||||||
|
|
||||||
|
```
|
||||||
|
dotinstall update bootstrap
|
||||||
|
```
|
||||||
|
|
||||||
## Boostrap file syntax
|
## Boostrap file syntax
|
||||||
|
|
||||||
`bootstrap` is a simple bash script sourced by `dotinstall`. The `bootstrap`
|
`bootstrap` is a simple bash script sourced by `dotinstall`. The `bootstrap`
|
||||||
|
@ -128,6 +134,23 @@ define_env "NOTMUCH_CONFIG" "~/.config/notmuch"
|
||||||
displayed.
|
displayed.
|
||||||
- `OVERWRITE_FILE` : do the same with file
|
- `OVERWRITE_FILE` : do the same with file
|
||||||
|
|
||||||
|
## Return code
|
||||||
|
|
||||||
|
This script return 0 if there is not error.
|
||||||
|
|
||||||
|
- **1** : no bootstrap specified.
|
||||||
|
- **2** : boostrap file not found
|
||||||
|
|
||||||
|
### Git relative error codes
|
||||||
|
|
||||||
|
- **20** : can't clone dotfile git repository.
|
||||||
|
- **24** : can't update dotfile git repository.
|
||||||
|
- **25** : local git repository does not exist.
|
||||||
|
|
||||||
|
### Script relative error code
|
||||||
|
|
||||||
|
- **128** : a binary checked by `chek_bin()` is not present
|
||||||
|
|
||||||
## Licence
|
## Licence
|
||||||
|
|
||||||
This software is licenced under the GNU-GPL 3 licence, you can found a copy of
|
This software is licenced under the GNU-GPL 3 licence, you can found a copy of
|
||||||
|
|
|
@ -342,7 +342,7 @@ case $1 in
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
[ "$*" = "" ] && die "You must specify a bootstrap file or repo" 10 1
|
[ "$*" = "" ] && die "You must specify a bootstrap file or repo" 1 1
|
||||||
|
|
||||||
if [[ $* =~ ^https://.*\.git$ || $* =~ ^ssh://.*\.git$ ]]
|
if [[ $* =~ ^https://.*\.git$ || $* =~ ^ssh://.*\.git$ ]]
|
||||||
then
|
then
|
||||||
|
@ -364,7 +364,7 @@ else
|
||||||
bootstrap_file="$*"
|
bootstrap_file="$*"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[ ! -f "$bootstrap_file" ] && die "$bootstrap_file does not exist" 10 1
|
[ ! -f "$bootstrap_file" ] && die "$bootstrap_file does not exist" 2 1
|
||||||
|
|
||||||
private:get_bootstrap_path "$bootstrap_file"
|
private:get_bootstrap_path "$bootstrap_file"
|
||||||
|
|
||||||
|
|
Reference in a new issue