dotfiles/tools/test.zsh
Dict Xiong 9a4c9556f6
[dev] common.sh parses args; riot; getdfs; install.sh -x KEY=VAL (#35)
* common.sh: export vars in env; zshrc: gdebug

* fix error when locale not exists

* DFS_COLOR

* common.sh: parse args automatically

* ci: test common.sh getopts

* common.sh: argparser supports spaces

* ciot: init

* ciot -> diot; remove sibd, sob and snasp

* rename diot -> riot

* update home0 ssh pubkey; fix ci temperarily

* gdebug will record time

* gdebug supports empty; --dry-run wip

* get.dotfiles.cn

* bug fix (Thu Jan  5 20:53:58 CST 2023)

* fix ci

* fix ci

* install.sh: -d will set -x

* ci: -asl

* getdfs: install for another user using -u <uname>

* try fix when su doesnot exist

* bug fix (Thu Jan  5 22:58:40 CST 2023)

* bug fix (Thu Jan  5 22:59:33 CST 2023)

* introduce SUDOE and so debug

* ask_for_yn now use stdout to return

* getdfs: support multiple users

* install.sh: -x to set dfs config; ci

* fix ci

* bug fix (Fri Jan  6 15:11:24 CST 2023)

* auto-detect DFS_NO_WALL

* bug fix (Fri Jan  6 15:43:25 CST 2023)

* getdfs: ${repo}

* bug fix (Fri Jan  6 16:08:41 CST 2023)

* getdfs: prompt user

Co-authored-by: xiongdian.me <xiongdian.me@bytedance.com>
2023-01-06 16:14:41 +08:00

55 lines
959 B
Bash

#!/bin/false "This script should be sourced in zsh, not executed directly"
set -ex
# check files
cd /
l
cd ~
l
dfs cd
l
pwd
test -f .zshrc2
diff -q ./.ssh/authorized_keys2 ~/.ssh/authorized_keys2
grep -q ".zshrc2" ~/.zshrc
# check scripts and functions
dfs version
dfs log 1
dfs beacon gh.ci
z ~
test ~ -ef "$(pwd)"
dogo
doll
dfs cd
./tools/test-getopts.sh
tools/common.sh get_os_type
tools/common.sh get_linux_dist
# check alias
alias p114
which riot
piv-agent || which piv-agent
gbes || which gbes
# check update
DFS_VERSION=`dfs version`
dfs update
dfs version
test `git rev-parse HEAD` = `curl -fsSL https://api.beardic.cn/get-var/dfs-commit-id`
# clean
git reset --hard $DFS_VERSION
# then check install.sh
./install.sh -dx DFS_CI=1
grep -q "DFS_CI=1" ~/.config/dotfiles/env
./install.sh -l -x DFS_CI=1
dfs version
test `git rev-parse HEAD` = `curl -fsSL https://api.beardic.cn/get-var/dfs-commit-id`
# clean
git reset --hard $DFS_VERSION
set +x