diff --git a/README_ZH.md b/README_ZH.md index e078cd072..d6e97ede1 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -15,6 +15,7 @@ gpm(Go 包管理工具) 是一款涵盖搜索、安装、更新、分享以 - 无需安装各类复杂的版本控制工具就可以从源代码托管平台下载并安装 Go 包。 - 从本地文件系统中删除 Go 包。 +- 检查并下载缺失的依赖包。 - 更多示例,参见 [快速入门](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` 才能正确完成安装。 +- 删除目录 `.git` 会因为权限不足而失败。 ## 授权许可 diff --git a/docs/Quick_Start.md b/docs/Quick_Start.md index 82f69cb83..95d525b7b 100644 --- a/docs/Quick_Start.md +++ b/docs/Quick_Start.md @@ -6,7 +6,7 @@ Full documentation please visit [GPMGo Documentation]()(Haven't done yet!). - [When and why](#when-and-why) - [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) - [ **Remove** package, or packages](#remove-package-or-packages) - [ 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`. -## 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). diff --git a/gpm.go b/gpm.go index 1bf546b2f..ff7904fb2 100644 --- a/gpm.go +++ b/gpm.go @@ -12,6 +12,7 @@ import ( "io" "os" "os/exec" + "path" "path/filepath" "runtime" "strings" @@ -111,7 +112,7 @@ var commands = []*Command{ // getAppPath returns application execute path for current process. func getAppPath() bool { // Look up executable in PATH variable. - appPath, _ = exec.LookPath("gpm") + appPath, _ = exec.LookPath(path.Base(os.Args[0])) if len(appPath) == 0 { fmt.Printf("ERROR: getAppPath -> Unable to indicate current execute path.\n") return false