forked from Superalgos/Superalgos
-
Notifications
You must be signed in to change notification settings - Fork 1
/
manageApps.js
executable file
·64 lines (60 loc) · 1.63 KB
/
manageApps.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/env node
const path = require('path')
const boxen = require('boxen')
/**
* @typedef {{
* name: string,
* hostPlatform: string,
* hostDesktop: string,
* portWssPlatform: number,
* portWssDesktop: number,
* portWssNetwork: number,
* portWssDashboard: number,
* portHttpPlatform: number,
* portHttpNetwork: number,
* portHttpDesktop: number,
* storeData: string,
* storeLogs: string,
* storeWorkspaces: string,
* }} Profile
*
* @type {{
* cwd: string,
* stdBoxedMessage: (string) => string,
* pm2m: {
* connect: () => Promise<void>,
* disconnect: () => Promise<void>,
* list: () => Promise<[]>,
* describe: (string) => Promise<{}>,
* start: ({}) => Promise<void>,
* startMany: ([]) => Promise<void>,
* restart: (string) => Promise<void>,
* restartMany: ([]) => Promise<void>,
* stop: (string) => Promise<void>,
* stopMany: ([]) => Promise<void>,
* kill: (string) => Promise<void>,
* killMany: ([]) => Promise<void>,
* },
* getProfile: (string) => Profile
* }}
*/
global.SAM = {
cwd: path.join(__dirname),
stdBoxedMessage: stdBoxedMessage,
pm2m: require('./App-Management/Pm2Management/manager').pm2Manager(),
getProfile: require('./Profile-Scripts/index').getProfile
}
/**
* @param {string} message
* @returns {string}
*/
function stdBoxedMessage(message) {
return boxen(message, {
borderColor: 'yellow',
title: 'Welcome to Superalgos Ecosystem App Management',
titleAlignment: 'center',
padding: 1,
margin: 1
})
}
require('./App-Management/AppManagementRoot').runRoot()