-
Notifications
You must be signed in to change notification settings - Fork 5
/
dxclient.mjs
39 lines (31 loc) · 1.21 KB
/
dxclient.mjs
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
35
36
37
38
import { exec } from 'child_process';
import { config } from 'dotenv';
config({path: './.dxclient.env'});
let verbose = (process.env.verbose === "true");
const dxClientCommand = `dxclient deploy-scriptapplication push` +
` -dxProtocol \"${process.env.dxProtocol}\"` +
` -hostname \"${process.env.dxHostName}\"` +
` -dxPort \"${process.env.dxPort}\"` +
` -dxUsername \"${process.env.dxUserName}\"` +
` -dxPassword \"${process.env.dxPassword}\"` +
` -contenthandlerPath \"${process.env.dxContentHandlerPath}\"` +
` -virtualPortalContext \"${process.env.dxVirtualPortalContext}\"` +
` -projectContext \"${process.env.dxProjectContext}\"` +
` -mainHtmlFile \"${process.env.dxMainHtmlFile}\"` +
` -wcmSiteArea \"${process.env.dxSiteArea}\"` +
` -wcmContentName \"${process.env.dxContentName}\"` +
` -wcmContentTitle \"${process.env.dxContentTitle}\"` +
` -contentRoot \"${process.env.dxContentRoot}\"`;
if(verbose) {
console.log(dxClientCommand);
}
exec(dxClientCommand, (err, stdout, stderr) => {
console.log(stdout);
if (err) {
if(verbose){
console.error(`\n${err}\n`);
} else {
console.log(`\nError calling dxclient. Please set verbose=true in .dxclient.env to see error details.\n`);
}
}
});