Browse Source

able to change name to others when has name conflict

pull/103/head
Unknown 12 years ago
parent
commit
659226d9ef
  1. 2
      README_ZH.md
  2. 4
      docs/Quick_Start.md
  3. 3
      gpm.go

2
README_ZH.md

@ -15,6 +15,7 @@ gpm(Go 包管理工具) 是一款涵盖搜索、安装、更新、分享以
- 无需安装各类复杂的版本控制工具就可以从源代码托管平台下载并安装 Go 包。 - 无需安装各类复杂的版本控制工具就可以从源代码托管平台下载并安装 Go 包。
- 从本地文件系统中删除 Go 包。 - 从本地文件系统中删除 Go 包。
- 检查并下载缺失的依赖包。
- 更多示例,参见 [快速入门](docs/Quick_Start_ZH.md) - 更多示例,参见 [快速入门](docs/Quick_Start_ZH.md)
## 主要命令 ## 主要命令
@ -28,6 +29,7 @@ gpm(Go 包管理工具) 是一款涵盖搜索、安装、更新、分享以
## 已知问题 ## 已知问题
- 当您使用命令例如 `gpm install -p bitbucket.org/zombiezen/gopdf` 时,你会在安装步骤时得到错误,虽然这是项目的根目录,但是并没有包含任何 Go 源代码,因此您必须使用 `gpm install -p bitbucket.org/zombiezen/gopdf/pdf` 才能正确完成安装。 - 当您使用命令例如 `gpm install -p bitbucket.org/zombiezen/gopdf` 时,你会在安装步骤时得到错误,虽然这是项目的根目录,但是并没有包含任何 Go 源代码,因此您必须使用 `gpm install -p bitbucket.org/zombiezen/gopdf/pdf` 才能正确完成安装。
- 删除目录 `.git` 会因为权限不足而失败。
## 授权许可 ## 授权许可

4
docs/Quick_Start.md

@ -6,7 +6,7 @@ Full documentation please visit [GPMGo Documentation]()(Haven't done yet!).
- [When and why](#when-and-why) - [When and why](#when-and-why)
- [Installation](#installation) - [Installation](#installation)
- [ **install** package, or packages](#install-package-or-packages) - [ **Install** package, or packages](#install-package-or-packages)
- [ **Build** and run it](#build-and-run-it) - [ **Build** and run it](#build-and-run-it)
- [ **Remove** package, or packages](#remove-package-or-packages) - [ **Remove** package, or packages](#remove-package-or-packages)
- [ Use **check** to check dependencies](#use-check-to-check-dependencies) - [ Use **check** to check dependencies](#use-check-to-check-dependencies)
@ -59,7 +59,7 @@ Because we don't have all kinds of operating systems, we need your help to compl
**Attention** Because we use API to get information of packages that are hosted on github.com, but it limits 60 requests per hour, so you may get errors if you download too much(more than 50 packages per hour). We do not provider access token for security reason, but we do have configure option `github_access_token` in configuration file `conf/gpm.toml`, so you can go to [here](https://github.com/settings/applications) and create your personal access token(up to 5000 request per hour), and set it in `gpm.toml`. **Attention** Because we use API to get information of packages that are hosted on github.com, but it limits 60 requests per hour, so you may get errors if you download too much(more than 50 packages per hour). We do not provider access token for security reason, but we do have configure option `github_access_token` in configuration file `conf/gpm.toml`, so you can go to [here](https://github.com/settings/applications) and create your personal access token(up to 5000 request per hour), and set it in `gpm.toml`.
## Download and install package, or packages ## Install package, or packages
Command `install` downloads and installs packages along with all dependencies(except when you use bundle or snapshot). Command `install` downloads and installs packages along with all dependencies(except when you use bundle or snapshot).

3
gpm.go

@ -12,6 +12,7 @@ import (
"io" "io"
"os" "os"
"os/exec" "os/exec"
"path"
"path/filepath" "path/filepath"
"runtime" "runtime"
"strings" "strings"
@ -111,7 +112,7 @@ var commands = []*Command{
// getAppPath returns application execute path for current process. // getAppPath returns application execute path for current process.
func getAppPath() bool { func getAppPath() bool {
// Look up executable in PATH variable. // Look up executable in PATH variable.
appPath, _ = exec.LookPath("gpm") appPath, _ = exec.LookPath(path.Base(os.Args[0]))
if len(appPath) == 0 { if len(appPath) == 0 {
fmt.Printf("ERROR: getAppPath -> Unable to indicate current execute path.\n") fmt.Printf("ERROR: getAppPath -> Unable to indicate current execute path.\n")
return false return false

Loading…
Cancel
Save