🐛 修复 #264

 支持 db.postAttachment 和 db.getAttachment
♻️ 重构版本更新机制
This commit is contained in:
muwoo
2023-10-18 11:02:14 +08:00
parent a7a85a7c62
commit bde5377282
12 changed files with 195 additions and 120 deletions

View File

@@ -157,13 +157,17 @@ class AdapterHandler {
*/
private async execCommand(cmd: string, modules: string[]): Promise<string> {
return new Promise((resolve: any, reject: any) => {
const args: string[] = [cmd]
.concat(
cmd !== 'uninstall' ? modules.map((m) => `${m}@latest`) : modules
)
.concat('--color=always')
.concat('--save')
.concat(`--registry=${this.registry}`);
let args: string[] = [cmd].concat(
cmd !== 'uninstall' && cmd !== 'link'
? modules.map((m) => `${m}@latest`)
: modules
);
if (cmd !== 'link') {
args = args
.concat('--color=always')
.concat('--save')
.concat(`--registry=${this.registry}`);
}
const npm = spawn('npm', args, {
cwd: this.baseDir,