diff --git a/src/command/sync/modules/base.ts b/src/command/sync/modules/base.ts
index 9fac86f..9641bab 100644
--- a/src/command/sync/modules/base.ts
+++ b/src/command/sync/modules/base.ts
@@ -20,7 +20,13 @@ const checkAuth = (value: string = '', baseURL: string = '') => {
};
const DEFAULT_IGNORE = [
- 'node_modules/**', '.git/**', '.next/**', '.astro/**', '.pack-dist/**',
+ 'node_modules/**',
+ '.git/**',
+ '.next/**',
+ '.astro/**',
+ '.pack-dist/**',
+ "dist/**",
+ ".swc/**"
];
export class SyncBase {
config: Config;
diff --git a/src/command/sync/sync.ts b/src/command/sync/sync.ts
index 0912f17..1254a6c 100644
--- a/src/command/sync/sync.ts
+++ b/src/command/sync/sync.ts
@@ -20,9 +20,11 @@ const syncUpload = new Command('upload')
.option('-d --dir
', '配置目录')
.option('-c --config ', '配置文件的名字', 'kevisual.json')
.option('-f --file ', '操作的对应的文件名')
+ .option('-l --list', '显示上传列表,不上传文件')
.description('上传项目, 上传需要和registry的地址同步。')
.action(async (opts) => {
console.log('上传项目');
+ const isUpload = opts.list ? false : true;
const sync = new SyncBase({ dir: opts.dir, baseURL: baseURL, configFilename: opts.config });
const syncList = await sync.getSyncList({ getFile: true });
logger.debug(syncList);
@@ -58,6 +60,10 @@ const syncUpload = new Command('upload')
if (filepath && item.filepath !== filepath.absolute) {
continue;
}
+ if (!isUpload) {
+ console.log('上传列表', item.key, chalk.green(item.url));
+ continue
+ }
const res = await upload({
token,
file: fs.readFileSync(item.filepath),
@@ -127,10 +133,12 @@ const syncList = new Command('list')
.option('-d --dir ', '配置目录')
.option('-c --config ', '配置文件的名字', 'kevisual.json')
.option('-a --all', '显示所有的文件')
+ .option('-l --local', '显示本地的文件列表')
.description('列出同步列表')
.action(async (opts) => {
const sync = new SyncBase({ dir: opts.dir, baseURL: baseURL, configFilename: opts.config });
- const syncList = await sync.getSyncList();
+ let getLocalFile = opts?.local ? true : false;
+ const syncList = await sync.getSyncList({ getFile: true, getLocalFile });
logger.debug(syncList);
logger.info('同步列表\n');
syncList.forEach((item) => {