Files
SmartisanNote.Remake/upload-pwa.js
袁涛 d1365aaaa5 新增 离线web应用发布流程;
移除了便签详情页;
优化了若干逻辑;
新增 移动端、IOS兼容处理;
2025-10-12 06:05:27 +08:00

33 lines
814 B
JavaScript

import path from 'path';
import { Client } from 'basic-ftp';
import config from './ftp-config.json' with { type: 'json' };
async function uploadPWA() {
const client = new Client();
client.ftp.verbose = true;
try {
await client.access({
host: config.host,
user: config.user,
password: config.password,
port: config.port,
});
// 上传PWA构建目录中的所有文件
const localPath = path.resolve('./dist/offline');
const remotePath = config.remotePath;
await client.ensureDir(remotePath);
await client.clearWorkingDir();
await client.uploadFromDir(localPath);
console.log('PWA版本已成功上传到FTP服务器');
} catch (error) {
console.error('FTP上传失败:', error);
} finally {
client.close();
}
}
uploadPWA();