add sync download

This commit is contained in:
2025-05-12 04:30:17 +08:00
parent 4aec2bc231
commit eaccbf5ada
14 changed files with 219 additions and 32 deletions

View File

@@ -9,9 +9,8 @@ import inquirer from 'inquirer';
import { packLib, unpackLib } from './publish.ts';
import chalk from 'chalk';
import { installDeps } from '@/uitls/npm.ts';
import cryptojs from 'crypto-js';
import { upload } from '@/module/download/upload.ts';
const MD5 = cryptojs.MD5;
import { getHash } from '@/uitls/hash.ts';
/**
* 获取package.json 中的 basename, version, user, appKey
* @returns
@@ -150,10 +149,7 @@ const command = new Command('deploy')
console.error('error', error);
}
});
export const getHash = (file: string) => {
const content = fs.readFileSync(file, 'utf-8');
return MD5(content).toString();
};
type UploadFileOptions = {
key: string;
version: string;