Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: fix typos #326

Merged
merged 1 commit into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/commands/activate.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func activateCmd(ctx *cli.Context) error {
path = strings.Replace(path, "\\", "/", -1)
s := shell.NewShell(name)
if s == nil {
return fmt.Errorf("unknow target shell %s", name)
return fmt.Errorf("unknown target shell %s", name)
}
exportStr := s.Export(exportEnvs)
str, err := s.Activate()
Expand Down
4 changes: 2 additions & 2 deletions cmd/commands/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func envFlag(ctx *cli.Context) error {
}
s := shell.NewShell(shellName)
if s == nil {
return fmt.Errorf("unknow target shell %s", shellName)
return fmt.Errorf("unknown target shell %s", shellName)
}
manager := internal.NewSdkManager()
defer manager.Close()
Expand Down Expand Up @@ -181,7 +181,7 @@ func aggregateEnvKeys(manager *internal.Manager) (internal.SdkEnvs, error) {
if lookupSdk, err := manager.LookupSdk(name); err == nil {
vv, ok := flushCache.Get(name)
if ok && string(vv) == version {
logger.Debugf("Hit cache, skip flush envrionment, %s@%s\n", name, version)
logger.Debugf("Hit cache, skip flush environment, %s@%s\n", name, version)
return true
} else {
logger.Debugf("No hit cache, name: %s cache: %s, expected: %s \n", name, string(vv), version)
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Only one situation will cause this, that is, you have used the SDK globally (`vf
operate the registry and write the SDK's `PATH` into the user environment variable (for the purpose of, **Shell that does not
support Hook function** can also use SDK, such as `CMD`).

But because of the existence of the `.tool-versions` mechanism, the `PATH` becomes the sum of `.tool-verions` and the user
But because of the existence of the `.tool-versions` mechanism, the `PATH` becomes the sum of `.tool-versions` and the user
environment variable `PATH`.

::: warning
Expand Down
4 changes: 2 additions & 2 deletions docs/guides/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ through a simple plugin interface.

#### [vfox](https://github.com/version-fox/vfox)

![pluigns](https://contrib.rocks/image?repo=version-fox/vfox)
![plugins](https://contrib.rocks/image?repo=version-fox/vfox)

#### [Public Registry](https://github.com/version-fox/vfox-plugins)

![pluigns](https://contrib.rocks/image?repo=version-fox/vfox-plugins))
![plugins](https://contrib.rocks/image?repo=version-fox/vfox-plugins))
2 changes: 1 addition & 1 deletion docs/misc/vs-asdf.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ But `vfox` has the following advantages:

## Performance comparison

![performence.png](/performence.png)
![performance.png](/performance.png)

The above figure is a benchmark test of the two tools' most core functions. It will be found that `vfox`
is about **5 times** faster than `asdf-vm`!
Expand Down
2 changes: 1 addition & 1 deletion docs/plugins/create/howto_registry.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ The registry is mainly divided into two parts:

The repository will automatically retrieve the latest version information of the plugin and verify
the availability of the plugin through the information in `sources` at regular intervals (every hour),
and store the obtained `manfiest` information in the `plugins` directory.
and store the obtained `manifest` information in the `plugins` directory.

::: tip Registry address
`vfox` will default to retrieve plugins from [vfox-plugins.lhan.me](https://vfox-plugins.lhan.me).
Expand Down
File renamed without changes
2 changes: 1 addition & 1 deletion docs/usage/all-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
```shell
vfox - vfox is a tool for runtime version management.
vfox available List all available plugins
vfox add [--alias <sdk-name> --source <url/path> ] <plugin-name> Add a plugin or plugins from offical repository or custom source, --alias` and `--source` are not supported when adding multiple plugins.
vfox add [--alias <sdk-name> --source <url/path> ] <plugin-name> Add a plugin or plugins from official repository or custom source, --alias` and `--source` are not supported when adding multiple plugins.
vfox remove <sdk-name> Remove a plugin
vfox update [<sdk-name> | --all] Update a specified or all plugin(s)
vfox info <sdk-name> Show plugin info
Expand Down
2 changes: 1 addition & 1 deletion docs/zh-hans/guides/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
只有一种情况下会出现这种情况, 就是你全局(`vfox use -g`)使用过SDK, 这个时候`vfox`会操作注册表,将SDK的`PATH`写入用户环境变量当中(为的是,
**不支持Hook功能**的Shell也能使用SDK, 例如`CMD`)。

但是因为`.tool-versions`机制的存在, 所以`PATH`就变成了`.tool-verions` + 用户环境变量`PATH`两部分组成。
但是因为`.tool-versions`机制的存在, 所以`PATH`就变成了`.tool-versions` + 用户环境变量`PATH`两部分组成。

::: warning
同一个SDK**最多重复两条**, 不会无限重复。如果>2次, 请反馈给我们。
Expand Down
4 changes: 2 additions & 2 deletions docs/zh-hans/guides/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ API、配置文件和实现方式(比如,`$PATH`

#### [核心仓库](https://github.com/version-fox/vfox)

![pluigns](https://contrib.rocks/image?repo=version-fox/vfox)
![plugins](https://contrib.rocks/image?repo=version-fox/vfox)

#### [插件仓库](https://github.com/version-fox/vfox-plugins)

![pluigns](https://contrib.rocks/image?repo=version-fox/vfox-plugins))
![plugins](https://contrib.rocks/image?repo=version-fox/vfox-plugins))
2 changes: 1 addition & 1 deletion docs/zh-hans/misc/vs-asdf.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

## 性能对比

![performence.png](/performence.png)
![performance.png](/performance.png)

上图是对两个工具最核心的功能进行基准测试, 会发现[vfox](https://github.com/version-fox/vfox)大约比`asdf-vm`快**5倍**!

Expand Down
2 changes: 1 addition & 1 deletion docs/zh-hans/plugins/create/howto_registry.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
- `plugins`: 用于存放插件的`manifest.json`文件, 以插件短名为文件名。例如`nodejs.json`
- `sources`: 用于存放插件的数据源信息, 以插件短名为文件名。例如`nodejs.json`

仓库将会自动定时(间隔一小时)通过`sources`中的信息检索插件的最新版本信息以及校验插件可用性, 并将获取的`manfiest`信息存放在`plugins`目录下。
仓库将会自动定时(间隔一小时)通过`sources`中的信息检索插件的最新版本信息以及校验插件可用性, 并将获取的`manifest`信息存放在`plugins`目录下。


::: tip 仓库地址
Expand Down
2 changes: 1 addition & 1 deletion docs/zh-hans/usage/all-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
```shell
vfox - vfox is a tool for runtime version management.
vfox available List all available plugins
vfox add [--alias <sdk-name> --source <url/path> ] <plugin-name> Add a plugin or plugins from offical repository or custom source, `--alias` and `--source` are not supported when adding multiple plugins.
vfox add [--alias <sdk-name> --source <url/path> ] <plugin-name> Add a plugin or plugins from official repository or custom source, `--alias` and `--source` are not supported when adding multiple plugins.
vfox remove <sdk-name> Remove a plugin
vfox update [<sdk-name> | --all] Update a specified or all plugin(s)
vfox info <sdk-name> Show plugin info
Expand Down
4 changes: 2 additions & 2 deletions internal/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ func (m *Manager) fetchPluginManifest(url string) (*RegistryPluginManifest, erro
}
body, err := io.ReadAll(resp.Body)
if err != nil {
return nil, fmt.Errorf("fetch manfiest error: %w", err)
return nil, fmt.Errorf("fetch manifest error: %w", err)
}
var plugin RegistryPluginManifest
if err = json.Unmarshal(body, &plugin); err != nil {
Expand Down Expand Up @@ -492,7 +492,7 @@ func (m *Manager) Add(pluginName, url, alias string) error {
func (m *Manager) installPluginToTemp(path string) (*LuaPlugin, error) {
ext := filepath.Ext(path)
if ext != ".lua" && ext != ".zip" {
return nil, fmt.Errorf("unsupported %s type plugin to install, only supoort .lua or .zip", ext)
return nil, fmt.Errorf("unsupported %s type plugin to install, only support .lua or .zip", ext)
}
localPath := path
// remote file, download it first to local file.
Expand Down
2 changes: 1 addition & 1 deletion internal/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ func NewLuaPlugin(pluginDirPath string, manager *Manager) (*LuaPlugin, error) {
}

if err := vm.Instance.DoFile(metadataPath); err != nil {
return nil, fmt.Errorf("failed to load meatadata file, %w", err)
return nil, fmt.Errorf("failed to load metadata file, %w", err)
}

// load hook func files
Expand Down
8 changes: 4 additions & 4 deletions internal/shim/shim_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,24 +84,24 @@ func (s *Shim) Generate() error {
ext := filepath.Ext(filename)
if ext == ".cmd" {
if err = os.WriteFile(targetPath, []byte(fmt.Sprintf(cmdShimContent, s.BinaryPath)), stat.Mode()); err != nil {
return fmt.Errorf("failed to gnerate shim: %w", err)
return fmt.Errorf("failed to generate shim: %w", err)
}
return nil
} else if ext == ".ps1" {
if err = os.WriteFile(targetPath, []byte(fmt.Sprintf(ps1ShimContent, s.BinaryPath)), stat.Mode()); err != nil {
return fmt.Errorf("failed to gnerate shim: %w", err)
return fmt.Errorf("failed to generate shim: %w", err)
}
return nil
}
logger.Debugf("Write shim binary to %s", targetPath)
if err = os.WriteFile(targetPath, shim, stat.Mode()); err != nil {
return fmt.Errorf("failed to gnerate shim: %w", err)
return fmt.Errorf("failed to generate shim: %w", err)
}
shimName := filename[:len(filename)-len(ext)] + ".shim"
shimFile := filepath.Join(s.OutputPath, shimName)
logger.Debugf("Write shim file to %s", shimFile)
if err = os.WriteFile(shimFile, []byte(fmt.Sprintf(shimFileContent, s.BinaryPath)), stat.Mode()); err != nil {
return fmt.Errorf("failed to gnerate shim: %w", err)
return fmt.Errorf("failed to generate shim: %w", err)
}
return nil
}
File renamed without changes.