mirror of
https://github.com/DictXiong/dotfiles.git
synced 2024-11-28 02:56:59 +08:00
install.sh: support combined options (#24)
* install.sh: support combined short options * ci: use combined opt * debug Co-authored-by: xiongdian.me <xiongdian.me@bytedance.com>
This commit is contained in:
parent
300b3a29b7
commit
9a7f0b1b06
6
.github/workflows/test.yml
vendored
6
.github/workflows/test.yml
vendored
|
@ -22,7 +22,7 @@ jobs:
|
|||
run: |
|
||||
rev=`git rev-parse HEAD`
|
||||
pwd
|
||||
./install.sh -d -l
|
||||
./install.sh -dl
|
||||
test `git rev-parse HEAD` = "$rev"
|
||||
|
||||
- name: antigen build
|
||||
|
@ -69,7 +69,7 @@ jobs:
|
|||
run: |
|
||||
rev=`git rev-parse HEAD`
|
||||
pwd
|
||||
./install.sh -d -l
|
||||
./install.sh -dl
|
||||
test `git rev-parse HEAD` = "$rev"
|
||||
|
||||
- name: antigen build
|
||||
|
@ -113,7 +113,7 @@ jobs:
|
|||
- name: install dfs
|
||||
run: |
|
||||
rev=`git rev-parse HEAD`
|
||||
./install.sh -d -a -l
|
||||
./install.sh -dal
|
||||
test `git rev-parse HEAD` = "$rev"
|
||||
|
||||
- name: antigen build with DFS_NO_WALL
|
||||
|
|
26
install.sh
26
install.sh
|
@ -253,16 +253,22 @@ uninstall(){
|
|||
}
|
||||
|
||||
BIN=install
|
||||
while [[ $# > 0 ]]; do
|
||||
case $1 in
|
||||
-i ) BIN=install ;;
|
||||
-r ) BIN=uninstall ;;
|
||||
-q|--quite ) export DFS_QUIET=1 ;;
|
||||
-d|--dev ) export DFS_DEV=1 ;;
|
||||
-l|--lite ) export DFS_LITE=1 ;;
|
||||
-a|--auto ) install_dependencies ;;
|
||||
* ) fmt_warning "unknown command \"$1\". available: -i, -r, -q, -d, -l, -a"; exit 1 ;;
|
||||
ARG=""
|
||||
while [[ $# > 0 || -n "$ARG" ]]; do
|
||||
if [[ -z "$ARG" ]]; then ARG=$1 ORIGIN_ARG=$1; shift; fi
|
||||
case $ARG in
|
||||
-i* ) BIN=install ;;
|
||||
-r* ) BIN=uninstall ;;
|
||||
-q*|--quite ) export DFS_QUIET=1 ;;
|
||||
-d*|--dev ) export DFS_DEV=1 ;;
|
||||
-l*|--lite ) export DFS_LITE=1 ;;
|
||||
-a*|--auto ) install_dependencies ;;
|
||||
* ) fmt_warning "unknown command \"$ORIGIN_ARG\". available: -i, -r, -q, -d, -l, -a"; exit 1 ;;
|
||||
esac
|
||||
shift
|
||||
if [[ "$ARG" == "--"* || ${#ARG} == 2 ]]; then
|
||||
ARG=""
|
||||
else
|
||||
ARG=-${ARG:2}
|
||||
fi
|
||||
done
|
||||
$BIN
|
||||
|
|
Loading…
Reference in New Issue
Block a user