-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathqs.sh
More file actions
70 lines (60 loc) · 2.07 KB
/
qs.sh
File metadata and controls
70 lines (60 loc) · 2.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/usr/bin/env bash
###
# Dye font
#
# @expamle
# echo -n "$tty_green 绿色文本"
# echo "${tty_reset} 恢复颜色"
###
if [[ -t 1 ]]; then
tty_escape() { printf "\x1b[%sm" $1; }
else
tty_escape() { :; }
fi
tty_universal() { tty_escape "0;$1"; } # normal
tty_mkbold() { tty_escape "1;$1"; } # highlight
tty_underline="$(tty_escape "4;39")" # underline
tty_blue="$(tty_universal 34)" # blue
tty_red="$(tty_universal 31)" # red
tty_green="$(tty_universal 32)" # green
tty_yellow="$(tty_universal 33)" # yellow
tty_bold="$(tty_universal 39)" # bold
tty_cyan="$(tty_universal 36)" # cyan
tty_reset="$(tty_escape 0)" # reset color
###
# Dye background
#
# @expamle
# echo -n "$tty_bg_green 绿色背景红色字"
# echo "${tty_reset} 恢复颜色"
###
tty_bg_blue="$(tty_universal 44)" # blue
tty_bg_red="$(tty_universal 41)" # red
tty_bg_green="$(tty_universal 42)" # green
tty_bg_yellow="$(tty_universal 43)" # yellow
tty_bg_cyan="$(tty_universal 46)" # cyan
# select which your shields are reply to the query:
reply_to_query() {
echo " ";
echo "[1] version,download,license"
echo " "
echo "Enter default to [1]\n"
# Input the number of the shields you want to use:
read -p "$tty_bg_cyan""Choose the labels$tty_reset " labels
read -p "$tty_bg_cyan""Input your package name$tty_reset " package_name
style="flat"
registry="https://www.npmjs.com/package"
# Return the default value if the input is empty
version_label="[]($registry/$package_name)"
download_able="[]($registry/$package_name)"
license_label="[]($registry/$package_name)"
travis_label=""
gratipay_label=""
coveralls_label=""
echo "
$version_label
$download_able
$license_label
"
}
reply_to_query