-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
executable file
·33 lines (23 loc) · 856 Bytes
/
test.js
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
#!/usr/bin/env node
// ===================================================================================
// This script will test a Temba server works by cloning it from the GitHub repository
// ===================================================================================
import { execSync } from "child_process";
const isDebugging = false;
// Logs to the console if debugging is enabled
const log = (message) => {
if (isDebugging) console.log(message);
};
// Runs a command in the current shell
const run = (command) => {
log(command);
execSync(`${command}`, { stdio: "inherit" });
};
const folder = "smoketest";
// Remove the folder if it already exists
run(`rm -rf ${folder}`);
// Call Temba starter script
run(`node bin/cli.js ${folder}`);
// Start the Temba server
run(`cd ${folder} && npm start`);
console.log("Done! 🎉");