-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpost-github.sh
More file actions
44 lines (32 loc) · 799 Bytes
/
post-github.sh
File metadata and controls
44 lines (32 loc) · 799 Bytes
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
#!/bin/bash
npm run build
use_template="react" # set you used template to update
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/";
if [ "$package" == "$use_template" ]; then
cp -r $package_dist $output_dir
fi
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
git add .
git commit -m "feat: update blog"
git push origin gh-pages