mirror of
https://gitee.com/chuangxxt/share-copilot
synced 2025-04-19 20:13:25 +00:00
Initial commit
This commit is contained in:
parent
d05bd9652e
commit
df0a863a7c
29
README.md
29
README.md
@ -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
|
||||
```
|
||||
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user