From 9f5228b7c861d72338db6c54d2dab724f28757b3 Mon Sep 17 00:00:00 2001
From: carsakiller <carsakiller@gmail.com>
Date: Fri, 17 Feb 2023 11:03:57 -0500
Subject: [PATCH] add: client build script #76

Edited VS Code build task to use new client build script
---
 .vscode/tasks.json | 50 +++++++++++++++++++---------------------------
 buildClient.sh     | 25 +++++++++++++++++++++++
 2 files changed, 46 insertions(+), 29 deletions(-)
 create mode 100644 buildClient.sh

diff --git a/.vscode/tasks.json b/.vscode/tasks.json
index 1653e33..547df14 100644
--- a/.vscode/tasks.json
+++ b/.vscode/tasks.json
@@ -1,31 +1,23 @@
 {
-    "version": "2.0.0",
-    "type": "shell",
-    "windows": {
-        "options": {
-            "shell": {
-                "executable": "C:\\Windows\\System32\\cmd.exe",
-                "args": [
-                    "/c"
-                ]
-            }
-        }
-    },
-    "options": {
-        "cwd": "${workspaceFolder}"
-    },
-    "tasks": [
-        {
-            "type": "typescript",
-            "tsconfig": "client/tsconfig.json",
-            "problemMatcher": [
-                "$tsc"
-            ],
-            "group": {
-                "kind": "build",
-                "isDefault": true
-            },
-            "label": "tsc: 构建 - client/tsconfig.json"
-        }
-    ]
+  "version": "2.0.0",
+  "tasks": [
+    {
+      "type": "shell",
+      "command": "./buildClient.sh",
+      "group": {
+        "kind": "build",
+        "isDefault": true
+      },
+      "presentation": {
+        "echo": true,
+        "reveal": "always",
+        "focus": false,
+        "panel": "dedicated",
+        "showReuseMessage": false,
+        "clear": true
+      },
+      "icon": { "color": "terminal.ansiCyan", "id": "server-process" },
+      "label": "Build Client"
+    }
+  ]
 }
diff --git a/buildClient.sh b/buildClient.sh
new file mode 100644
index 0000000..694f0fe
--- /dev/null
+++ b/buildClient.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+set -e
+
+bold=$(tput bold)
+normal=$(tput sgr0)
+
+black='\e[0;30m'
+red='\e[0;31m'
+green='\e[0;32m'
+cyan='\e[0;36m'
+
+echo -e "${red}${bold}Building VS Code Extension Client..."
+
+echo -e "${cyan}${bold}Compiling TypeScript...${black}${normal}"
+cd client
+npm i
+npm run build
+
+echo -e "${green}${bold}Building Addon Manager WebVue...${black}${normal}"
+cd webvue
+npm i
+npm run build
+
+echo -e "${green}${bold}Build complete!${black}${normal}"
-- 
GitLab