浏览代码

GOPATH set as systemd environment variable

Bob Mottram 10 年前
父节点
当前提交
a5e4a59e14
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4
    1
      src/freedombone

+ 4
- 1
src/freedombone 查看文件

6715
 
6715
 
6716
   # install Go
6716
   # install Go
6717
   apt-get -y install golang
6717
   apt-get -y install golang
6718
-  echo 'export GOPATH=/home/git/go' >> ~/.bashrc
6718
+  if ! grep -q "export GOPATH=/home/git/go" ~/.bashrc; then
6719
+      echo 'export GOPATH=/home/git/go' >> ~/.bashrc
6720
+      echo 'systemctl set-environment GOPATH=/home/git/go' >> ~/.bashrc
6721
+  fi
6719
   . ~/.bashrc
6722
   . ~/.bashrc
6720
   export GOPATH=/home/git/go
6723
   export GOPATH=/home/git/go
6721
   if [ ! -d $GOPATH ]; then
6724
   if [ ! -d $GOPATH ]; then