Initial commit
This commit is contained in:
26
task/inject
Executable file
26
task/inject
Executable file
@@ -0,0 +1,26 @@
|
||||
#!/bin/sh
|
||||
|
||||
injection="$1"
|
||||
tmp="$(mktemp)"
|
||||
|
||||
awk '
|
||||
BEGIN {
|
||||
s="<!-- start injection -->"
|
||||
e="<!-- end injection -->"
|
||||
}
|
||||
|
||||
FILENAME != "index.html" {
|
||||
d=d $0 "\n"
|
||||
next
|
||||
}
|
||||
$0 == s || $0 == e { print }
|
||||
$0 == s,$0 == e {
|
||||
if(d) {
|
||||
printf d;
|
||||
d = ""
|
||||
}
|
||||
next
|
||||
}
|
||||
{ print }
|
||||
' "$injection" index.html > "$tmp" \
|
||||
&& mv "$tmp" index.html
|
||||
15
task/setup-build
Executable file
15
task/setup-build
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
|
||||
name="$1"
|
||||
|
||||
task/inject "targets/${name}.html"
|
||||
rm -rf build/*
|
||||
|
||||
cp -r src/ build/
|
||||
cp -r assets/ build/
|
||||
cp -r lib/ build/
|
||||
|
||||
cp index.html package.json debug.js build/
|
||||
|
||||
mkdir -p build/device
|
||||
cp "device/${name}.js" build/device
|
||||
Reference in New Issue
Block a user