https://github.com/ymc-github/sh-lib-lang
some function for handle lang for ymc shell lib
https://github.com/ymc-github/sh-lib-lang
lang sh-lib ymc
Last synced: 3 months ago
JSON representation
some function for handle lang for ymc shell lib
- Host: GitHub
- URL: https://github.com/ymc-github/sh-lib-lang
- Owner: YMC-GitHub
- License: mit
- Created: 2020-06-25T12:28:02.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-07-22T08:53:11.000Z (almost 4 years ago)
- Last Synced: 2025-01-07T23:44:35.078Z (5 months ago)
- Topics: lang, sh-lib, ymc
- Language: Shell
- Homepage:
- Size: 16.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# sh lib lang
## descsome function for handle lang for ymc shell lib
## deps
### test
- [x] sh-lib-path-resolve
- [x] sh-lib-test
- [x] sh-lib-time-cost
- [x] sh-lib-project-dir-map### prod
- [ ] xxx
## apis
- [x] lang_type_set
- [x] lang_type_get
- [x] lang_step_set
- [x] lang_step_now
- [x] lang_step_get
- [x] lang_sample```sh
cat src/index.sh | grep "function " | sed "s/function */- [x] /g" | sed "s/(.*) *{//g"
```## feats
- [x] set operation step
- [x] get current step
- [x] support multi language## usage
### how to use for poduction?
```sh
# get the code# run the index file
# ./src/index.sh# or import to your sh file
# source /path/to/the/index file# simple usage
desc=$(cat <#1.1 创建主机地址文件
lang_step_now "2" # =>#1.2 测试主机是否在线lang_type_set "en"
lang_step_now "1" # => #1.1 create host ip file
lang_step_now "2" # => #1.2 ping to check if host is onlinelang_type_set "zh"
lang_step_now "1" # =>#1.1 创建主机地址文件
lang_step_now "2" # =>#1.2 测试主机是否在线
lang_step_now "1.2" "" "step_mode" # =>#1.2 测试主机是否在线
```### how to use for developer?
```sh
# get the code# run test
./test/index.sh
#2 get some fail test
./test/index.sh | grep "it is false"
```## author
yemiancheng
## license
MIT