Initial commit

This commit is contained in:
ben Gutier 2023-09-09 11:49:30 +08:00
parent d05bd9652e
commit df0a863a7c
2 changed files with 31 additions and 4 deletions

View File

@ -3,15 +3,36 @@
```
测试环境:Linux4.18.0-305.3.1.el8.x86_64 GNU/Linux
```
# 一、自编译:
需要 go环境 出问题自行chatgpt
```sh
https://dl.google.com/go/go1.21.1.linux-amd64.tar.gz
tar -C /usr/local -xzf go1.21.1.linux-amd64.tar.gz
vim ~/.bashrc
//添加下列环境
export PATH=$PATH:/usr/local/go/bin
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
source ~/.bashrc
//验证安装
go version
cd /share-copilot/source
go build
```
# 二、使用现成:
### 1.安装
```sh
git clone https://gitlab.com/luyoyu/share-copilot.git
```
git clone https://gitee.com/chuangxxt/share-copilot.git
```
```
```sh
cd share-copilot
```
```
```sh
bash install.sh
```

View File

@ -156,6 +156,12 @@ func initConfig() Config {
if err != nil {
panic("file \"./config.json\" not found")
}
// 获取可执行文件所在目录
exeDir := filepath.Dir(exePath)
configFile, err := os.Open(exeDir + "/config.json")
if err != nil {
panic("file \"./config.json\" not found")
}
defer func(configFile *os.File) {
err := configFile.Close()
if err != nil {