Build to /site instead. Makes things a bit safer.

This commit is contained in:
noirscape 2021-05-13 22:20:59 +02:00
parent 70e978cb54
commit af8d9426a2
6 changed files with 146 additions and 165 deletions

5
.gitignore vendored
View File

@ -1,4 +1 @@
hekate.bin.js
lockpick.bin.js
tegraexplorer.bin.js
index.html
site

View File

@ -1,15 +0,0 @@
generate_files:
@python gen_contents.py
clean:
@rm hekate.bin.js
@rm lockpick.bin.js
@rm tegraexplorer.bin.js
@rm index.html
.PHONY: help
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.DEFAULT_GOAL := help

View File

@ -3,8 +3,3 @@ Fusee Launcher, in a browser!
# Description
This is a fork of [web-fusee-launcher](https://github.com/atlas44/web-fusee-launcher), which is a port of [fusee-launcher](https://github.com/reswitched/fusee-launcher) to JavaScript using WebUSB. This has been mildly tested and appears to work on Linux, Android (unrooted), OSX and ChromeOS. Today, this only works on Chrome because only Chrome implements WebUSB. It also does NOT work on Windows because the WebUSB Windows implementation does not allow sending the required USB packet.
# fork changes
* Hekate latest.
* You need to gen that automatically.

View File

@ -1,6 +1,7 @@
import requests
import io
import shutil
import os
import zipfile
bin_files = {
@ -98,7 +99,7 @@ def serialize_to_js(short_name: str, payload: io.BytesIO, filename: str):
final_str = "".join(final_str)
out_string = DEFAULT_SERIALIZED_CONTENTS.format(short_name, final_str)
with open(filename, "w") as outfile:
with open(f"site/{filename}", "w") as outfile:
outfile.write(out_string)
def generate_js(program: str):
@ -130,14 +131,17 @@ def generate_html():
out_string = "".join(html_data_list)
with open("index.html", "w") as indexfile:
with open("site/index.html", "w") as indexfile:
indexfile.write(out_string)
def main():
os.makedirs("site", exist_ok=True)
generate_js("hekate")
generate_js("tegraexplorer")
generate_js("lockpick")
generate_html()
shutil.copy("js/main.js", "site/main.js")
shutil.copy("js/fusee.bin.js", "site/fusee.bin.js")
if __name__ == "__main__":
main()

View File