summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2023-10-14 16:20:25 +0800
committerlittleblack111 <littleblack11111@gmail.com>2023-10-14 16:20:25 +0800
commit6dce4e2e8ed35a26af389b7ab388113381350444 (patch)
treefaec54d7858dd7c3d494cfb0e45537bc7ee68832
parentfee47f6414cc3ae9a88f3ee0ed20f1d6f2d9f556 (diff)
added functions to build, start
-rwxr-xr-xlaunch.sh16
-rw-r--r--package.json4
2 files changed, 17 insertions, 3 deletions
diff --git a/launch.sh b/launch.sh
index d14f143a..78124fba 100755
--- a/launch.sh
+++ b/launch.sh
@@ -1,4 +1,4 @@
-function selfcheck() {
+function check() {
printf '\033[0;35mCode Checking Starts...\033[0m\n'
html5validator --also-check-css --also-check-svg --verbose | npx gnomon || printf '\033[0;31mCode Check Failed...\033[0m\n'
# sleep .5
@@ -7,13 +7,25 @@ function selfcheck() {
# sleep .5
}
+function buildcss() {
+ printf '\033[0;35mCode CSS Build Starts...\033[0m\n'
+ npm run build:css || printf '\033[0;31mCode CSS Build Failed...\033[0m\n'
+}
+
+function buildjs() {
+ printf '\033[0;35mCode JavaScript Compile Starts...\033[0m\n'
+ npm run build:js || printf '\033[0;31mCode JavaScript Compile Failed...\033[0m\n'
+}
+
function start() {
printf '\033[0;32mNpx Server Starting...\033[0m\n'
exec npx serve -d -p 209 #| npx gnomon;
}
function main() {
- selfcheck
+ check
+ buildcss
+ buildjs
start
}
diff --git a/package.json b/package.json
index b370104f..256da777 100644
--- a/package.json
+++ b/package.json
@@ -6,7 +6,9 @@
"scripts": {
"build:css": "postcss src/css/* --dir dest/css",
"watch:css": "postcss src/css/* --dir dest/css --watch",
- "build:js": "babel src/js/* --out-dir dest/js"
+ "build:js": "babel src/js/* --out-dir dest/js",
+ "dev": "./launch.sh",
+ "check": "./launch.sh check"
},
"keywords": [],
"author": "littleblack111",