summaryrefslogtreecommitdiff
path: root/extension/scripts/package.js
blob: 4703ebc2a354854d5f6ad8b26555c01f2288f173 (plain)
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
const { exec } = require("child_process");
const fs = require("fs");

exec("npm install", (error) => {
  if (error) throw error;
  console.log("npm install completed");

  exec("npm run typegen", (error) => {
    if (error) throw error;
    console.log("npm run typegen completed");

    exec("npm run clientgen", (error) => {
      if (error) throw error;
      console.log("npm run clientgen completed");

      process.chdir("react-app");

      exec("npm install", (error) => {
        if (error) throw error;
        console.log("npm install in react-app completed");

        exec("npm run build", (error) => {
          if (error) throw error;
          console.log("npm run build in react-app completed");

          process.chdir("..");

          if (!fs.existsSync("build")) {
            fs.mkdirSync("build");
          }

          exec("vsce package --out ./build", (error) => {
            if (error) throw error;
            console.log("vsce package completed");
          });
        });
      });
    });
  });
});