Skip to content

Commit

Permalink
upload修改
Browse files Browse the repository at this point in the history
  • Loading branch information
liuruoran88 committed Sep 19, 2018
1 parent 3c4a780 commit f449c52
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,23 @@ cp -rf . ../$output/
cd ../$output/
rm 'upload.sh'
rm -rf '.git'

#修改组件模板变量的三个文件
newContent='所需脚本| {% if: {{ name }} %}{% if: {{ name }} === 'mip2-extensions' %}[https://c.mipcdn.com/static/v2/{{ compName }}/{{ compName }}.js](https://c.mipcdn.com/static/v2/{{ compName }}/{{ compName }}.js){% else %}[https://c.mipcdn.com/extensions/platform/v2/{{name}}/{{ compName }}/{{ compName }}.js](https://c.mipcdn.com/extensions/platform/v2/{{name}}/{{ compName }}/{{ compName }}.js){% /if %}{% /if %}'

#1.mip-example.html
sed -i '' 's/mip-example/\{\{ compName \}\}/g' mip-component/components/mip-example/example/mip-example.html
#2.README.md
sed -i '' 's/mip-example/\{\{ compName \}\}/' mip-component/components/mip-example/README.md
sed -i '' "/所需脚本/ c\
${newContent}
" mip-component/components/mip-example/README.md
#3.package.json
sed -i '' 's/\"name\": \"name\"/\"name\": \"\{\{ name \}\}\"/g' package.json
sed -i '' 's/\"description\": \"description\"/\"description\": \"\{\{ description \}\}\"/g' package.json
sed -i '' 's/\"author\": \"yourname\"/\"author\": \"\{\{ yourname \}\}\"/g' package.json


zip -r ../mip-plugin-site-template.zip . .[^.]*
rm -rf ./*
mv ../mip-plugin-site-template.zip ./mip-plugin-site-template.zip
Expand Down

0 comments on commit f449c52

Please sign in to comment.