-
Notifications
You must be signed in to change notification settings - Fork 0
/
adjust.sh
36 lines (24 loc) · 921 Bytes
/
adjust.sh
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
# !/usr/bin/env bash
CSS_FILE=$(find dist/assets -type f -name "index.*.css")
JS_FILE=$(find dist/assets -type f -name "index.*.js")
# CSS_STRIPPED=$(echo "$CSS_FILE" | sed "s/dist\/assets\///g")
# JS_STRIPPED=$(echo "$JS_FILE" | sed "s/dist\/assets\///g")
# JS2_STRIPPED=$(echo "$JS_FILE[1]" | sed "s/dist\/assets\///g")
# arr=()
js=0
css=0
for i in $JS_FILE
do
TEMP=$(echo "$i" | sed "s/dist\/assets\///g")
sed -i'.bak' -e "s/id=\"replaceMeJS$js\"/type=\"module\" crossorigin src=\".\/assets\/$TEMP\"/g" dist/index.html
let "js+=1"
done
for i in $CSS_FILE
do
TEMP=$(echo "$i" | sed "s/dist\/assets\///g")
sed -i'.bak' -e "s/id=\"replaceMeCSS$css\"/rel=\"stylesheet\" href=\".\/assets\/$TEMP\"/g" dist/index.html
let "css+=1"
done
# sed -i'.bak' -e "s/id=\"replaceMeJS\"/type=\"module\" src=\".\/assets\/${arr[0]}\"/g" dist/index.html
rm -rf dist/static/
rm -rf dist/index.html.bak