Ai
1 Star 0 Fork 1

ttpc2008/BaiduPCS-Go

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
cd.go 684 Bytes
一键复制 编辑 原始数据 按行查看 历史
konica 提交于 2018-05-17 21:55 +08:00 . fix #187, ls 增加详细显示选项
package pcscommand
import (
"fmt"
"github.com/iikira/BaiduPCS-Go/baidupcs"
"github.com/iikira/BaiduPCS-Go/internal/pcsconfig"
)
// RunChangeDirectory 执行更改工作目录
func RunChangeDirectory(path string, isList bool) {
path, err := getAbsPath(path)
if err != nil {
fmt.Println(err)
return
}
data, err := GetBaiduPCS().FilesDirectoriesMeta(path)
if err != nil {
fmt.Println(err)
return
}
if !data.Isdir {
fmt.Printf("错误: %s 不是一个目录 (文件夹)\n", path)
return
}
GetActiveUser().Workdir = path
pcsconfig.Config.Save()
fmt.Printf("改变工作目录: %s\n", path)
if isList {
RunLs(".", nil, baidupcs.DefaultOrderOptions)
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ttpc2008/BaiduPCS-Go.git
git@gitee.com:ttpc2008/BaiduPCS-Go.git
ttpc2008
BaiduPCS-Go
BaiduPCS-Go
v3.5.6

搜索帮助