From 4adeeea83647e114d6cf72ddbb1957dca78e3807 Mon Sep 17 00:00:00 2001 From: afeiship <1290657123@qq.com> Date: Sat, 14 Oct 2023 09:19:30 +0800 Subject: [PATCH] feat: add change dir --- src/index.ts | 2 ++ src/lib/cd.ts | 3 +++ 2 files changed, 5 insertions(+) create mode 100644 src/lib/cd.ts diff --git a/src/index.ts b/src/index.ts index 99aeaaf..f87cc70 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1,4 @@ +import cd from './lib/cd'; import cp_r from './lib/cp_r'; import ls from './lib/ls'; import mkdir_p from './lib/mkdir_p'; @@ -10,6 +11,7 @@ import rm_rf from './lib/rm_rf'; declare var wx: any; const Fileutils = { + cd, cp_r, ls, mkdir_p, diff --git a/src/lib/cd.ts b/src/lib/cd.ts new file mode 100644 index 0000000..9d2d907 --- /dev/null +++ b/src/lib/cd.ts @@ -0,0 +1,3 @@ +export default (dir) => { + return process.chdir(dir); +};