diff --git a/.gitignore b/.gitignore
index 7663c2e..8435e09 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,9 +2,9 @@
pkg
bin2
bin/i18n
-bin/leanote-linux
-bin/leanote-mac
+bin/leanote*
bin/release
+bin/test.sh
bin/tmp
bin/test
bin/src
diff --git a/app/init.go b/app/init.go
index 6d4501b..934452e 100644
--- a/app/init.go
+++ b/app/init.go
@@ -10,8 +10,8 @@ import (
"github.com/leanote/leanote/app/controllers/admin"
"github.com/leanote/leanote/app/controllers/member"
_ "github.com/leanote/leanote/app/lea/binder"
- "github.com/leanote/leanote/app/lea/session"
- "github.com/leanote/leanote/app/lea/memcache"
+// "github.com/leanote/leanote/app/lea/session"
+// "github.com/leanote/leanote/app/lea/memcache"
"github.com/leanote/leanote/app/lea/route"
"reflect"
"fmt"
@@ -33,11 +33,11 @@ func init() {
// AuthFilter, // Invoke the action.
revel.FilterConfiguringFilter, // A hook for adding or removing per-Action filters.
revel.ParamsFilter, // Parse parameters into Controller.Params.
- // revel.SessionFilter, // Restore and write the session cookie.
+ revel.SessionFilter, // Restore and write the session cookie.
// 使用SessionFilter标准版从cookie中得到sessionID, 然后通过MssessionFilter从Memcache中得到
// session, 之后MSessionFilter将session只存sessionID然后返回给SessionFilter返回到web
- session.SessionFilter, // leanote session
+ // session.SessionFilter, // leanote session
// session.MSessionFilter, // leanote memcache session
revel.FlashFilter, // Restore and write the flash cookie.
@@ -367,7 +367,7 @@ func init() {
// email配置
InitEmail()
InitVd()
- memcache.InitMemcache() // session服务
+ // memcache.InitMemcache() // session服务
// 其它service
service.InitService()
controllers.InitService()
diff --git a/app/views/home/header.html b/app/views/home/header.html
index 566d1c7..99b4558 100644
--- a/app/views/home/header.html
+++ b/app/views/home/header.html
@@ -44,7 +44,7 @@ function log(o) {
-->
{{msg . "download"}}
{{msg . "donate"}}
- lea++
+ lea++
{{msg . "discussion"}}
@@ -92,7 +92,6 @@ function log(o) {
- {{msg . "home"}}
- - {{msg . "download"}}
- {{msg . "donate"}}
- lea++
-
diff --git a/app/views/home/index_en.html b/app/views/home/index_en.html
index ac17e51..74aabca 100644
--- a/app/views/home/index_en.html
+++ b/app/views/home/index_en.html
@@ -66,20 +66,6 @@
-
-
{{msg . "download"}}
-
-
-
-
-
{{msg . "donate"}}
diff --git a/app/views/home/index_zh.html b/app/views/home/index_zh.html
index 4dae8ff..156e8bb 100644
--- a/app/views/home/index_zh.html
+++ b/app/views/home/index_zh.html
@@ -64,20 +64,6 @@
-
-
{{msg . "download"}}
-
-
-
-
-
{{msg . "donate"}}
diff --git a/bin/release.sh b/bin/release.sh
index c4de806..6fd1b83 100644
--- a/bin/release.sh
+++ b/bin/release.sh
@@ -2,40 +2,79 @@
# release leanote
+# 当前路径
SP=$(cd "$(dirname "$0")"; pwd)
-cd $SP
-cd ../
-
# tmp path to store leanote release files
tmp="/Users/life/Desktop/leanote_release"
-version=x86_64.v1.0-beta.2
+# version
+V="v1.0-beta.4"
+##=================================
+# 1. 先build 成 3个平台, 2种bit = 6种
+##=================================
+
+# cd /Documents/Go/package2/src/github.com/leanote/leanote/bin
+# GOOS=darwin GOARCH=amd64 go build -o leanote-darwin-amd64 ../app/tmp
+
+cd $SP
+
+# $1 = darwin, linux
+# $2 = amd64
+function build()
+{
+ echo build-$1-$2
+ if [ $1 = "linux" -o $1 = "darwin" ]
+ then
+ suffix=""
+ else
+ suffix=".exe"
+ fi
+
+ GOOS=$1 GOARCH=$2 go build -o leanote-$1-$2$suffix ../app/tmp
+}
+
+build "linux" "386";
+build "linux" "amd64";
+build "darwin" "386";
+build "darwin" "amd64";
+build "windows" "386";
+build "windows" "amd64";
+
+
+##======================
+# 2. release目录准备工作
+##======================
rm -rf $tmp/leanote
mkdir -p $tmp/leanote/app
mkdir -p $tmp/leanote/conf
mkdir -p $tmp/leanote/bin
+##==================
+# 3. 复制
+##==================
+
+cd $SP
+cd ../
+
# bin
cp -r ./bin/src $tmp/leanote/bin/
cp ./bin/run.sh $tmp/leanote/bin/
-
-# LICENSE
-cp ./LICENSE $tmp/leanote/
+cp ./bin/run.bat $tmp/leanote/bin/
# views
cp -r ./app/views $tmp/leanote/app
-# 可不要
-cp -r ./app/service $tmp/leanote/app/service
-cp -r ./app/controllers $tmp/leanote/app/controllers
-cp -r ./app/db $tmp/leanote/app/db
-cp -r ./app/info $tmp/leanote/app/info
-cp -r ./app/lea $tmp/leanote/app/lea
+# 可不要, 源码
+#cp -r ./app/service $tmp/leanote/app/service
+#cp -r ./app/controllers $tmp/leanote/app/controllers
+#cp -r ./app/db $tmp/leanote/app/db
+#cp -r ./app/info $tmp/leanote/app/info
+#cp -r ./app/lea $tmp/leanote/app/lea
# conf
-cp ./conf/app.conf-default $tmp/leanote/conf/app.conf
-cp ./conf/routes-default $tmp/leanote/conf/routes
+cp ./conf/app.conf $tmp/leanote/conf/app.conf
+cp ./conf/routes $tmp/leanote/conf/routes
# others
cp -r ./messages ./public ./mongodb_backup $tmp/leanote/
@@ -44,40 +83,55 @@ cp -r ./messages ./public ./mongodb_backup $tmp/leanote/
rm -r $tmp/leanote/public/tinymce/classes
rm -r $tmp/leanote/public/upload
mkdir $tmp/leanote/public/upload
-mkdir $tmp/leanote/files
rm -r $tmp/leanote/public/.codekit-cache
rm $tmp/leanote/public/.DS_Store
rm $tmp/leanote/public/config.codekit
# make link
-cd $tmp/leanote/bin
-mkdir ./src/github.com/leanote
+# cd $tmp/leanote/bin
# ln -s ../../../../ ./src/github.com/leanote/leanote
# archieve
# << 'BLOCK
-# linux
-cd $SP
-cd ../
-cp ./bin/leanote-linux $tmp/leanote/bin/
-cd $tmp
-tar -cvf $tmp/leanote-linux-$version.bin.tar leanote
-gzip $tmp/leanote-linux-$version.bin.tar
-# mac
-rm $tmp/leanote/bin/leanote-linux
-cd $SP
-cd ../
-cp ./bin/leanote-mac $tmp/leanote/bin/
-cd $tmp
-tar -cvf $tmp/leanote-mac-$version.bin.tar leanote
-gzip $tmp/leanote-mac-$version.bin.tar
+##===========
+# 4. 打包
+##===========
+# $1 = linux
+# $2 = 386, amd64
-cd $SP
-cd ../
-cp ./bin/leanote-linux $tmp/leanote/bin/
+# 创建一个$V的目录存放之
+rm -rf $tmp/$V
+mkdir $tmp/$V
-rm $tmp/bin/src/github.com/leanote/leanote
-cp -r $tmp/leanote/* $tmp/leanote_release_github
+function tarRelease()
+{
+ echo tar-$1-$2
+ cd $SP
+ cd ../
+ rm $tmp/leanote/bin/leanote-* # 删除之前的bin文件
+ rm $tmp/leanote/bin/run* # 删除之前的run.sh 或 run.bat
+
+ if [ $1 = "linux" -o $1 = "darwin" ]
+ then
+ suffix=""
+ cp ./bin/run.sh $tmp/leanote/bin/
+ else
+ cp ./bin/run.bat $tmp/leanote/bin/
+ suffix=".exe"
+ fi
+
+ cp ./bin/leanote-$1-$2$suffix $tmp/leanote/bin/
+ cd $tmp
+ tar -cf $tmp/$V/leanote-$1-$2-$V.bin.tar leanote
+ gzip $tmp/$V/leanote-$1-$2-$V.bin.tar
+}
+
+tarRelease "linux" "386";
+tarRelease "linux" "amd64";
+tarRelease "darwin" "386";
+tarRelease "darwin" "amd64";
+tarRelease "windows" "386";
+tarRelease "windows" "amd64";
# BLOCK'
\ No newline at end of file
diff --git a/bin/run.bat b/bin/run.bat
new file mode 100644
index 0000000..e422721
--- /dev/null
+++ b/bin/run.bat
@@ -0,0 +1,23 @@
+@echo off
+
+cd..
+set SCRIPTPATH=%cd%
+
+: top src directory
+set path="%SCRIPTPATH%\bin\src\github.com\leanote"
+
+if not exist "%path%" mkdir "%path%"
+
+: create software link
+if exist "%path%\leanote" del /Q "%path%\leanote"
+mklink /D "%path%\leanote" %SCRIPTPATH%
+
+: set GOPATH
+set GOPATH=%GOPATH%;"%SCRIPTPATH%\bin"
+
+: run
+if %processor_architecture%==x86 (
+ "%SCRIPTPATH%\bin\leanote-windows-386.exe" -importPath github.com/leanote/leanote
+) else (
+ "%SCRIPTPATH%\bin\leanote-windows-amd64.exe" -importPath github.com/leanote/leanote
+)
diff --git a/bin/run.sh b/bin/run.sh
index 304a6e6..2832656 100644
--- a/bin/run.sh
+++ b/bin/run.sh
@@ -7,17 +7,16 @@ path="$SCRIPTPATH/src/github.com/leanote"
if [ ! -d "$path" ]; then
mkdir -p "$path"
fi
+rm -rf $SCRIPTPATH/src/github.com/leanote/leanote # 先删除
ln -s ../../../../ $SCRIPTPATH/src/github.com/leanote/leanote
# set GOPATH
export GOPATH=$GOPATH:$SCRIPTPATH
# run
-osName=`uname`
-if [ $osName == "Darwin" ]; then
- chmod 777 "$SCRIPTPATH/leanote-mac"
- "$SCRIPTPATH/leanote-mac" -importPath github.com/leanote/leanote
-else
- chmod 777 "$SCRIPTPATH/leanote-linux"
- "$SCRIPTPATH/leanote-linux" -importPath github.com/leanote/leanote
-fi
+osName=`uname` # Darwin or Linux
+osName=`tr '[A-Z]' '[a-z]' <<<"$osName"` # toLowerCase
+bit=`getconf LONG_BIT` # 32, 64
+script="$SCRIPTPATH/leanote-$osName-$bit"
+chmod 777 $script
+$script -importPath github.com/leanote/leanote
\ No newline at end of file