Skip to content

Commit

Permalink
docs: fix error download link of cli
Browse files Browse the repository at this point in the history
  • Loading branch information
wenfengwang committed Apr 25, 2024
1 parent a42d21e commit 80c36eb
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 12 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ DOCKER_PLATFORM ?= linux/amd64,linux/arm64
build-npi:
$(GO_BUILD) -ldflags "${LD_FLAGS}" -o ${CMD_OUTPUT_DIR}/npi ${NPI_CMD_ROOT}/cli

release-npi-cli:
$(GO_BUILD) -ldflags "${LD_FLAGS}" -o ${CMD_OUTPUT_DIR}/cli/npi ${NPI_CMD_ROOT}/cli
zip -j ${CMD_OUTPUT_DIR}/npi-${VERSION}-${GOOS}-${GOARCH}.zip ${CMD_OUTPUT_DIR}/npi

docker-build:
docker buildx build --platform ${DOCKER_PLATFORM} -t npiai/npi:${IMAGE_TAG} . --push

Expand Down
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,18 @@ and applications.
Download the binary from the following links.

```sh
# For amr64
curl -O https://s.npi.ai/cli/v0.0.1/arm64/npi
# For amd64
curl -O https://s.npi.ai/cli/v0.0.1/amd64/npi
# For darwin/arm64
curl -O https://s.npi.ai/cli/latest/darwin/arm64/npi

# For darwin/amd64
curl -O https://s.npi.ai/cli/latest/darwin/amd64/npi

# For linux/arm64
curl -O https://s.npi.ai/cli/latest/linux/arm64/npi

# For linux/amd64
curl -O https://s.npi.ai/cli/latest/linux/amd64/npi

```

Then move it to `/usr/local/bin` or any other directory in your `PATH`:
Expand Down
2 changes: 1 addition & 1 deletion cli/global.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func checkUpdate() error {
latest := CMDLatestVersion{}
_ = json.Unmarshal(response.Body(), &latest)
if strings.Compare(Version, latest.Version) < 0 {
color.Green("new version detected: %s, current version: %s. Download url: %s/%s", latest.Version, Version, latest.URL, Platform)
color.Green("new version detected: %s, current version: %s. Please follow https://docs.npi.ai/cli for updating.", latest.Version, Version)
// TODO download the latest version
} else {
_, _ = f.Seek(0, 0)
Expand Down
14 changes: 7 additions & 7 deletions docs/pages/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,28 @@ NPi (**N**atural-language **P**rogramming **I**nterface), pronounced as **"N π"
<Tabs items={['macOS/arm64','macOS/amd64','linux/arm64','linux/amd64']}>
<Tabs.Tab>
```sh
curl -O https://s.npi.ai/cli/v0.0.1/darwin/arm64/npi
curl -O https://s.npi.ai/cli/latest/darwin/arm64/npi
chmod +x npi
sudo mv npi /usr/local/bin
```
</Tabs.Tab>
<Tabs.Tab>
```sh
curl -O https://s.npi.ai/cli/v0.0.1/darwin/amd64/npi
curl -O https://s.npi.ai/cli/latest/darwin/amd64/npi
chmod +x npi
sudo mv npi /usr/local/bin
```
</Tabs.Tab>
<Tabs.Tab>
```sh
curl -O https://s.npi.ai/cli/v0.0.1/linux/arm64/npi
curl -O https://s.npi.ai/cli/latest/linux/arm64/npi
chmod +x npi
sudo mv npi /usr/local/bin
```
</Tabs.Tab>
<Tabs.Tab>
```sh
curl -O https://s.npi.ai/cli/v0.0.1/linux/amd64/npi
curl -O https://s.npi.ai/cli/latest/linux/amd64/npi
chmod +x npi
sudo mv npi /usr/local/bin
```
Expand All @@ -50,9 +50,9 @@ NPi (**N**atural-language **P**rogramming **I**nterface), pronounced as **"N π"

```json
{
"BuildDate": "2024-04-25_10:15:33-0500",
"GitCommit": "5ae9953",
"Platform": "darwin/arm64",
"BuildDate": "2024-04-25_11:18:19-0500",
"GitCommit": "708a7be",
"Platform": "linux/amd64",
"Version": "v0.0.1"
}
```
Expand Down

0 comments on commit 80c36eb

Please sign in to comment.