填坑铺路20160910

前端之家收集整理的这篇文章主要介绍了填坑铺路20160910前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

m-site 项目:

build文件:

#!/bin/bash

fe=.
rd=../m
output=../bdg-m-fe-compiled

output_public=$output/public

cd $fe

git pull
npm install --registry=https://registry.npm.taobao.org

if [[ $1 == "fast" ]]; then
gulp
else
gulp min
fi

test -d $output_public || mkdir -p $output_public

test -d $fe/output/asset && cp -r $fe/output/asset $output_public
test -d $fe/output/dep && cp -r $fe/output/dep $output_public

test -d $fe/output/view && cp -r $fe/output/view $output

build-norelease.sh:

#!/bin/bash

br=$1

fe=.
rd=../m
output=../bdg-m-fe-compiled

output_public=$output/public

cd $fe

git fetch
if [[ "" != "$br" ]] ; then
git branch | grep -E "\b$br\b"
if [[ $? == 0 ]]; then
git checkout $1
else
git branch -a | grep -E "\b$br\b"
if [[ $? == 0 ]]; then
git checkout -t origin/$br
else
echo "分支$br不存在"
exit 1
fi
fi

fi

git pull
npm install --registry=https://registry.npm.taobao.org

gulp

test -d $output_public || mkdir -p $output_public

test -d $fe/output/asset && cp -r $fe/output/asset $output_public
test -d $fe/output/dep && cp -r $fe/output/dep $output_public

test -d $fe/output/view && cp -r $fe/output/view $output

build-branch.sh:

#!/bin/bash

fe=.
rd=../m
output=../bdg-m-fe-compiled

output_public=$output/public

cd $fe

git pull
if [[ ! -z $1 ]]; then
git checkout $1
if [[ 0 != $? ]]; then
echo "branch $1 不存在"
exit 127
fi
git pull
fi

npm install --registry=https://registry.npm.taobao.org

gulp

test -d $output_public || mkdir -p $output_public

test -d $fe/output/asset && cp -r $fe/output/asset $output_public
test -d $fe/output/dep && cp -r $fe/output/dep $output_public

test -d $fe/output/view && cp -r $fe/output/view $output

经过测试 smarty{{ $smarty.server.HTTP_HOST}{$smarty.server.REQUEST_URI }} 相当于 js 的 location.href 还有项目里面用的 smarty 版本是2.1,所以支持{}这种语法...所以说以后再也不用{{ if ... }}这样了,直接{if ...}好好哇...突然发现2.1的版本还是不支持啊...弄错了不好意思...还是用回{{ ... }}吧??刚刚说错了好多东西...记得在 smarty doc 里面看到过好像有个 delimeter...的有关设置还是什么...忘了...版本变化一般来讲和这个设置无关...

猜你在找的程序笔记相关文章