TimothyYe / skm

A simple and powerful SSH keys manager
https://timothyye.github.io/skm
MIT License
954 stars 54 forks source link

无法自定义--store-path #25

Closed 8w7BG7l2nMNm0g09FZzAz3zlt closed 5 years ago

8w7BG7l2nMNm0g09FZzAz3zlt commented 5 years ago

skm init时指定非默认--store-path不生效

1.我的环境 image 2.操作过程 2.1 删除/root/.skm 2.2 已确认--store-path不存在 image 3.默认--store-path正常 image 4.已确认使用centos出现同样问题 5.简单看了下main.go,没看出来...... image

是我打开方式不对吗

TimothyYe commented 5 years ago

store-path 应该是一个全局参数,初始化的时候用来指定自定义key store位置。

初始化完成过后,其他命令,也需要带上这个参数,所以你的demo应该改成:

skm --store-path "/data/testskm" ls
TimothyYe commented 5 years ago

当然,这样每次输入都要带上这个参数,用起来也许很不方便,我考虑一下初始化过后如何把这个自定义store path保存下来,方便其他命令直接读取。

TimothyYe commented 5 years ago

这个可以作为下一个版本的改进

8w7BG7l2nMNm0g09FZzAz3zlt commented 5 years ago

store-path 应该是一个全局参数,初始化的时候用来指定自定义key store位置。

初始化完成过后,其他命令,也需要带上这个参数,所以你的demo应该改成:

skm --store-path "/data/testskm" ls

可以了,多谢大佬

TimothyYe commented 5 years ago

@buyaofangqizhiliao V0.8 发布了,可以通过导出环境变量的方式自定义store path https://github.com/TimothyYe/skm/releases/tag/V0.8

用法参考: https://github.com/TimothyYe/skm#customized-ssh-key-store-path