-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathdeployextra.js
More file actions
34 lines (27 loc) · 889 Bytes
/
deployextra.js
File metadata and controls
34 lines (27 loc) · 889 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
const ftp = require('basic-ftp');
const path = require('path');
const settings = require('./.ftpdeploy.js');
async function deployExtra() {
const client = new ftp.Client();
client.ftp.verbose = falce;
try {
await client.access({
host: settings.host,
port: settings.port,
user: settings.user,
password: settings.password,
secure: false // FTP. Use true for FTPS
});
const localRoot = path.join(__dirname, 'samples');
const remoteRoot = settings.remoteRoot + 'Samples';
await client.ensureDir(remoteRoot);
// Upload everything (matches your old include: ["*"])
await client.uploadFromDir(localRoot);
console.log('Extra deploy complete');
} catch (err) {
console.error(err);
} finally {
client.close();
}
}
deployExtra();