You've already forked SmartisanNote.Remake
新增 离线web应用发布流程;
移除了便签详情页; 优化了若干逻辑; 新增 移动端、IOS兼容处理;
This commit is contained in:
33
upload-pwa.js
Normal file
33
upload-pwa.js
Normal file
@@ -0,0 +1,33 @@
|
||||
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();
|
||||
Reference in New Issue
Block a user