2022-07-21 16:31:01 +08:00
|
|
|
#!/bin/sh
|
2022-07-20 21:30:13 +08:00
|
|
|
FLAG_OK="\033[32m[ OK ]\033[0m"
|
|
|
|
FLAG_INFO="\033[32m[Info]\033[0m"
|
|
|
|
FLAG_NOTE="\033[35m[Note]\033[0m"
|
2022-07-20 21:54:54 +08:00
|
|
|
FLAG_ERROR="\033[31m[Error]\033[0m"
|
2022-07-20 21:30:13 +08:00
|
|
|
|
2022-04-19 18:30:24 +08:00
|
|
|
if [ $# != 1 ] ; then
|
|
|
|
echo "USAGE: $0 [pkg name]"
|
|
|
|
echo " e.g.: $0 ctypes"
|
|
|
|
exit 1;
|
|
|
|
fi
|
2022-07-20 21:54:54 +08:00
|
|
|
|
2021-12-13 22:16:50 +08:00
|
|
|
pkg=$1
|
2022-07-20 21:54:54 +08:00
|
|
|
|
|
|
|
# Check if the package exists
|
|
|
|
if [ ! -d package/pikascript/pikascript-lib/$pkg ] ; then
|
2022-07-21 16:31:01 +08:00
|
|
|
echo "$FLAG_ERROR Package $pkg does not exist"
|
2022-07-20 21:54:54 +08:00
|
|
|
exit 1;
|
|
|
|
fi
|
|
|
|
|
2022-07-20 22:02:46 +08:00
|
|
|
rm ../../package/$pkg -rf
|
2022-04-07 22:57:59 +08:00
|
|
|
cp package/pikascript/pikascript-lib/$pkg ../../package/ -r
|
|
|
|
git add package/pikascript/pikascript-lib/$pkg
|
2022-07-20 21:30:13 +08:00
|
|
|
|
|
|
|
# check if $pkg.pyi is exit
|
|
|
|
if [ -f "package/pikascript/$pkg.pyi" ] ; then
|
2022-07-21 16:31:01 +08:00
|
|
|
echo "$FLAG_INFO python interface files added"
|
2022-07-20 21:30:13 +08:00
|
|
|
cp package/pikascript/$pkg.pyi ../../package/$pkg/
|
2022-07-08 09:33:53 +00:00
|
|
|
git add package/pikascript/$pkg.pyi
|
2022-07-20 21:30:13 +08:00
|
|
|
echo "$pkg.pyi"
|
|
|
|
fi
|
|
|
|
|
2022-08-06 20:55:07 +08:00
|
|
|
# check if $_pkg.pyi is exit
|
|
|
|
if [ -f "package/pikascript/_$pkg.pyi" ] ; then
|
|
|
|
echo "$FLAG_INFO python interface files added"
|
2022-08-06 22:32:26 +08:00
|
|
|
cp "package/pikascript/_$pkg.pyi" ../../package/$pkg
|
2022-08-06 20:55:07 +08:00
|
|
|
git add package/pikascript/_$pkg.pyi
|
|
|
|
echo "_$pkg.pyi"
|
|
|
|
fi
|
|
|
|
|
2022-07-20 21:30:13 +08:00
|
|
|
# check if $pkg.py is exit
|
|
|
|
if [ -f "package/pikascript/$pkg.py" ] ; then
|
2022-07-21 16:31:01 +08:00
|
|
|
echo "$FLAG_INFO python files added"
|
2022-07-20 21:30:13 +08:00
|
|
|
cp package/pikascript/$pkg.py ../../package/$pkg/
|
2022-07-12 15:12:37 +08:00
|
|
|
git add package/pikascript/$pkg.py
|
2022-07-20 21:30:13 +08:00
|
|
|
echo "$pkg.py"
|
|
|
|
fi
|
2022-07-04 17:59:59 +08:00
|
|
|
|
2022-07-20 21:39:58 +08:00
|
|
|
# check if test/python/$pkg folder is exit
|
|
|
|
if [ -d "test/python/$pkg" ] ; then
|
2022-07-21 16:31:01 +08:00
|
|
|
echo "$FLAG_INFO python test files added:"
|
2022-08-06 23:29:14 +08:00
|
|
|
rm ../../examples/$pkg -rf
|
|
|
|
mkdir ../../examples/$pkg
|
2022-07-20 21:39:58 +08:00
|
|
|
cp test/python/$pkg/*.py ../../examples/$pkg -r
|
2022-07-26 10:50:20 +08:00
|
|
|
git add test/python/$pkg
|
2022-07-20 21:39:58 +08:00
|
|
|
git add ../../examples/$pkg
|
|
|
|
ls ../../examples/$pkg
|
|
|
|
fi
|
|
|
|
|
2022-04-07 22:57:59 +08:00
|
|
|
git add ../../package/$pkg
|
2022-07-21 16:31:01 +08:00
|
|
|
echo "$FLAG_INFO lib files added:"
|
2022-07-20 21:30:13 +08:00
|
|
|
# list files name in package/pikascript/pikascript-lib/$pkg
|
|
|
|
ls package/pikascript/pikascript-lib/$pkg
|
2022-07-21 16:31:01 +08:00
|
|
|
echo "$FLAG_OK Push \033[32m$pkg\033[0m to ../../package/$pkg successfully!"
|
|
|
|
echo "$FLAG_NOTE Now, you can run 'git commit -a' to commit changes."
|
|
|
|
echo "$FLAG_NOTE Then, you can run 'git push' to push to github/gitee."
|