Skip to content

Commit

Permalink
build: fix dir in build-pwa.py
Browse files Browse the repository at this point in the history
  • Loading branch information
RodrigoDornelles committed Oct 27, 2023
1 parent 529238a commit 6a44a70
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion build-pwa.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@
from base64 import b64encode as b64
import requests
import sys
import os

title = 'Coco Battle Royale II'
input = './bin/cocobattleroyale.nes'
output = './html/usa.html'


if not os.path.exists('html'):
os.mkdir('html')

if '--jap' in sys.argv:
title = 'Kokobatoru 2'
input = './bin/kokobatoru.nes'
Expand All @@ -17,7 +22,7 @@
cdn = 'https://cdn.jsdelivr.net/gh/takahirox/[email protected]/build'
with requests.get(f'{cdn}/{file_name}', stream=True) as download:
file_name = file_name.replace(r'.min.js', '.js')
open(f'./html/{file_name}', "x").write(download.text)
open(f'./html/{file_name}', "w+").write(download.text)

rom = b64(open(input, "rb").read()).decode()
html = open("./res/index.html", "r").read()
Expand Down

0 comments on commit 6a44a70

Please sign in to comment.