forked from aaPanel/BaoTa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathw
151 lines (124 loc) · 3.57 KB
/
w
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
#!/usr/bin/env bash
help() {
local usage=" Explorer builder autoscript -h\n
Please try select any of these cmd - testnet,dx1\n
example\n
testnet: sh build.sh testnet\n
production: sh build.sh dx1\n
skip upload: sh build.sh testnet -test\n
skip upload: sh build.sh dx1 -test\n
try to help it out
"
echo $usage
}
abort_program() {
cd $BUILD_DIR
rm -f $FILE
exit
}
rename_pyc_to_regular() {
local path=$1
local build="pycbuild"
python3 -c "$_c"
}
linuxtools() {
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
#https://snapcraft.io/install/solc/centos
sudo yum install rsync
}
#--combined-json abi,asm,ast,bin,bin-runtime,compact-format,devdoc,hashes,interface,metadata,opcodes,srcmap,srcmap-runtime,userdoc
mactools() {
# -----------------------------------------------
if ! command -v cnpm &>/dev/null; then
echo "cnpm could not be found"
npm i -g cnpm
fi
# -----------------------------------------------
if ! command -v rsync &>/dev/null; then
echo "rsync could not be found"
brew install rsync
fi
# -----------------------------------------------
if ! command -v abi-gen-uni &>/dev/null; then
echo "abi-gen-uni could not be found. please check the official source from: https://www.npmjs.com/package/easy-abi-gen"
cnpm i -g easy-abi-gen
fi
# -----------------------------------------------
if ! command -v abigen &>/dev/null; then
echo "golang abigen could not be found"
exit
fi
#NVM_VERSION=$(echo "$(node -v)" | grep -o -E '[0-9]{2}.')
local NVM_VERSION=$(echo "$(node -v)" | cut -d. -f1)
echo "==> 🈯️ all modules needed are completed."
# -----------------------------------------------
if [[ ${NVM_VERSION} == "v10" ]]; then
echo "node version is on the right version : v10"
else
echo "please use the below command to switch to the right version of node"
echo "nvm use 10"
exit
fi
# -----------------------------------------------
python3 -m compileall .
}
# Accepts a version string and prints it incremented by one.
# Usage: increment_version <version> [<position>] [<leftmost>]
increment_version() {
declare -a part=(${1//\./ })
declare new
declare -i carry=1
for ((CNTR = ${#part[@]} - 1; CNTR >= 0; CNTR -= 1)); do
len=${#part[CNTR]}
new=$((part[CNTR] + carry))
[ ${#new} -gt $len ] && carry=1 || carry=0
[ $CNTR -gt 0 ] && part[CNTR]=${new: -len} || part[CNTR]=${new}
done
new="${part[*]}"
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
echo -e "${new// /.}"
elif [[ "$OSTYPE" == "darwin"* ]]; then
echo "${new// /.}"
elif [[ "$OSTYPE" == "cygwin" ]]; then
echo "not correct system - cygwin detected"
exit
fi
}
preinstall() {
npm install -g dts-gen
npm install typescript --save-dev
pip3 install git+git://github.com/psf/black
}
mod_package_json() {
param_chan=$(echo "$1 = \"$2\"")
echo "$param_chan"
cat $NODEPFILE | jq "$param_chan" $NODEPFILE | sponge $NODEPFILE
}
auto_install_nvm() {
# shellcheck disable=SC2077
if [[ $auto_install == 1 ]]; then
$CMD_FINAL
fi
}
gitconnectiontest() {
ssh -Tvvv [email protected]
ssh -T [email protected]
}
fixmessedupgit() {
git rm -r --cached .
git add .
git commit -am 'git cache cleared'
git push
}
gitpush() {
local gitcheck=$(git diff --shortstat)
git add .
#git remote add origin ${GIT_LOC}.git
git pull --recurse-submodules
git add .
git commit -m "See this 🍣 ${gitcheck}"
git push origin
# git push bitbucket
echo "♻️ You can open from the list of url as shown below"
git remote -v
}