Files
leanote/bin/run.sh

29 lines
606 B
Bash
Raw Normal View History

2014-05-07 13:01:21 +08:00
#!/bin/sh
SCRIPTPATH=$(cd "$(dirname "$0")"; pwd)
# set link
2014-12-07 22:02:01 +08:00
path="$SCRIPTPATH/src/github.com/leanote"
if [ ! -d "$path" ]; then
mkdir -p "$path"
fi
2015-04-20 19:51:20 +08:00
rm -rf $SCRIPTPATH/src/github.com/leanote/leanote # 先删除
2014-12-07 22:02:01 +08:00
ln -s ../../../../ $SCRIPTPATH/src/github.com/leanote/leanote
2014-05-07 13:01:21 +08:00
# set GOPATH
2015-09-17 18:52:10 +08:00
export GOPATH=$SCRIPTPATH
2014-05-07 13:01:21 +08:00
# run
2015-04-20 19:51:20 +08:00
osName=`uname` # Darwin or Linux
osName=`tr '[A-Z]' '[a-z]' <<<"$osName"` # toLowerCase
bit=`getconf LONG_BIT` # 32, 64
2015-04-20 20:51:03 +08:00
if [ $bit = "64" ]
then
bit="amd64"
else
bit="386"
fi
2015-04-20 19:51:20 +08:00
script="$SCRIPTPATH/leanote-$osName-$bit"
chmod 777 $script
$script -importPath github.com/leanote/leanote