From e0cda3502c73146bd9fa29eeb8447a31830a34a1 Mon Sep 17 00:00:00 2001 From: Jordan Last Date: Wed, 15 Jan 2020 23:35:34 -0700 Subject: [PATCH] add more languages to the static build --- package-lock.json | 2 +- package.json | 2 +- src/static-builder.ts | 142 ++++++++++++++++++++++++------------------ 3 files changed, 83 insertions(+), 63 deletions(-) diff --git a/package-lock.json b/package-lock.json index b0671539..2e50e77d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "zwitterion", - "version": "0.44.0", + "version": "0.44.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index bdb5e455..bac5fb7a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zwitterion", - "version": "0.44.0", + "version": "0.44.1", "description": "A web dev server that lets you import anything*", "scripts": { "start": "ts-node --transpile-only src/app.ts --port 5050", diff --git a/src/static-builder.ts b/src/static-builder.ts index 2b6e3811..fad986c3 100644 --- a/src/static-builder.ts +++ b/src/static-builder.ts @@ -74,67 +74,87 @@ export function buildStatic(params: { fi done - #echo "Download and save all .rs files from Zwitterion" - - #shopt -s globstar - #for file in **/*.rs; do - # if [[ ! $file =~ ${excludeRegex} ]] - # then - # wget -q -x -nH "http://localhost:${params.httpPort}/$\{file%.*\}.rs" - # fi - #done - - #echo "Download and save all .tsx files from Zwitterion" - - #shopt -s globstar - #for file in **/*.tsx; do - # if [[ ! $file =~ ${excludeRegex} ]] || [[ $file =~ ${includeRegex} ]] - # then - # echo $file - # wget -q -x -nH "http://localhost:${params.httpPort}/$\{file%.*\}.tsx" - # fi - #done - - #echo "Download and save all .jsx files from Zwitterion" - - #shopt -s globstar - #for file in **/*.jsx; do - # if [[ ! $file =~ ${excludeRegex} ]] || [[ $file =~ ${includeRegex} ]] - # then - # echo $file - # wget -q -x -nH "http://localhost:${params.httpPort}/$\{file%.*\}.jsx" - # fi - #done - - #echo "Download and save all .c files from Zwitterion" - - #shopt -s globstar - #for file in **/*.c; do - # if [[ ! $file =~ ${excludeRegex} ]] - # then - # wget -q -x -nH "http://localhost:${params.httpPort}/$\{file%.*\}.c" - # fi - #done - - #echo "Download and save all .cc files from Zwitterion" - - #shopt -s globstar - #for file in **/*.cc; do - # if [[ ! $file =~ ${excludeRegex} ]] - # then - # wget -q -x -nH "http://localhost:${params.httpPort}/$\{file%.*\}.cc" - # fi - #done - - #echo "Download and save all .cpp files from Zwitterion" - - #shopt -s globstar - #for file in **/*.cpp; do - # if [[ ! $file =~ ${excludeRegex} ]] - # then - # wget -q -x -nH "http://localhost:${params.httpPort}/$\{file%.*\}.cpp" - # fi - #done + echo "Download and save all .rs files from Zwitterion" + + shopt -s globstar + for file in **/*.rs; do + if [[ ! $file =~ ${excludeRegex} ]] + then + wget -q -x -nH "http://localhost:${params.httpPort}/$\{file%.*\}.rs" + fi + done + + echo "Download and save all .tsx files from Zwitterion" + + shopt -s globstar + for file in **/*.tsx; do + if [[ ! $file =~ ${excludeRegex} ]] || [[ $file =~ ${includeRegex} ]] + then + echo $file + wget -q -x -nH "http://localhost:${params.httpPort}/$\{file%.*\}.tsx" + fi + done + + echo "Download and save all .jsx files from Zwitterion" + + shopt -s globstar + for file in **/*.jsx; do + if [[ ! $file =~ ${excludeRegex} ]] || [[ $file =~ ${includeRegex} ]] + then + echo $file + wget -q -x -nH "http://localhost:${params.httpPort}/$\{file%.*\}.jsx" + fi + done + + echo "Download and save all .c files from Zwitterion" + + shopt -s globstar + for file in **/*.c; do + if [[ ! $file =~ ${excludeRegex} ]] + then + wget -q -x -nH "http://localhost:${params.httpPort}/$\{file%.*\}.c" + fi + done + + echo "Download and save all .cc files from Zwitterion" + + shopt -s globstar + for file in **/*.cc; do + if [[ ! $file =~ ${excludeRegex} ]] + then + wget -q -x -nH "http://localhost:${params.httpPort}/$\{file%.*\}.cc" + fi + done + + echo "Download and save all .cpp files from Zwitterion" + + shopt -s globstar + for file in **/*.cpp; do + if [[ ! $file =~ ${excludeRegex} ]] + then + wget -q -x -nH "http://localhost:${params.httpPort}/$\{file%.*\}.cpp" + fi + done + + echo "Download and save all .c++ files from Zwitterion" + + shopt -s globstar + for file in **/*.c++; do + if [[ ! $file =~ ${excludeRegex} ]] + then + wget -q -x -nH "http://localhost:${params.httpPort}/$\{file%.*\}.c++" + fi + done + + echo "Download and save all .wat files from Zwitterion" + + shopt -s globstar + for file in **/*.wat; do + if [[ ! $file =~ ${excludeRegex} ]] + then + wget -q -x -nH "http://localhost:${params.httpPort}/$\{file%.*\}.wat" + fi + done echo "Copy ZWITTERION_TEMP to dist directory in the project root directory"