Skip to content

Commit

Permalink
Merge pull request kcl-lang#32 from zong-zhe/add-details-readme
Browse files Browse the repository at this point in the history
feat: add how to set env in README.
  • Loading branch information
zong-zhe committed Apr 13, 2023
2 parents 0f2a1b1 + 15d8f12 commit 9dc3288
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
17 changes: 17 additions & 0 deletions README-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,23 @@ GLOBAL OPTIONS:
--version, -v print the version
```

### 设置环境变量

你需要设置一个环境变量 KPM_HOME 来声明 `kpm` 下载的 KCL 包的位置。

注意: 目前 `kpm` 不支持将外部的包下载到包的内部,所以请确保 `$KPM_HOME` 目录下没有 `kcl.mod` 文件。

```shell
# Kpm 下载的包将会保存在 /user/xxx/xxx/path 目录下.
export KPM_HOME="/user/xxx/xxx/path"
```

在成功安装 KCLVM 后,为了确保 KCLVM 可以找到 `kpm` 下载的包,你需要设置环境变量 $KCLVM_VENDOR_HOME 并将其指向 $KPM_HOME。

```shell
export KCLVM_VENDOR_HOME=$KPM_HOME
```

## 快速开始

### 初始化一个空的 KCL 包
Expand Down
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,23 @@ GLOBAL OPTIONS:
--version, -v print the version
```

### Set environment variables

You need to set an environment variable `KPM_HOME` to hold the KCL packages downloaded by `kpm`.

Note: `kpm` does not support downloading external packages into the current kcl package directory, so make sure there is no `kcl.mod` file in the $KPM_HOME directory.

```shell
# The directory to save the packages downloaded by Kpm.
export KPM_HOME="/user/xxx/xxx/path"
```

To ensure that KCLVM can find the packages downloaded by `kpm`, you need to set the environment variables `$KCLVM_VENDOR_HOME` and point it to `$KPM_HOME` for KCLVM after downloading KCLVM.

```shell
export KCLVM_VENDOR_HOME=$KPM_HOME
```

## Quick Start

### Init an empty kcl package
Expand Down

0 comments on commit 9dc3288

Please sign in to comment.