From fb13ff10865af5b0bc9894de215fb502295b78a4 Mon Sep 17 00:00:00 2001 From: wuyunzhu Date: Sun, 22 Sep 2024 21:34:23 +0800 Subject: [PATCH] feat: add post github sh --- post-github.sh | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100755 post-github.sh diff --git a/post-github.sh b/post-github.sh new file mode 100755 index 0000000..c48f4d2 --- /dev/null +++ b/post-github.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +npm run build + + + +output_dir="./build_file" +rm -rf $output_dir +mkdir $output_dir +search_dir="./packages/" + +for package in `ls $search_dir`; do + package_dist="$search_dir$package/dist/"; + cp -r $package_dist $output_dir +done + + + +git stash +git branch -D gh-pages +git fetch -p +git checkout -b gh-pages origin/gh-pages + + +for file in ./*; do + # echo $file; + if [[ "$file" != "./post-github.sh" && + "$file" != "./build_file" && + "$file" != "./packages" && + "$file" != "./node_modules" + ]]; then + rm -r "$file" + fi +done + + +mv $output_dir/* ./ +rm -rf $output_dir \ No newline at end of file