Skip to content

Commit 81550a4

Browse files
committed
net/webrepl/webrepl_setup.py: Create boot.py if it doesn't exist.
Check for boot.py during setup and create it if it doesn't exist
1 parent fbf7e12 commit 81550a4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

micropython/net/webrepl/webrepl_setup.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ def exists(fname):
3939
return False
4040

4141

42+
def validate_boot_file():
43+
if not exists(RC):
44+
with open(RC, "w") as f:
45+
f.write("# boot.py -- run on boot-up\n")
46+
47+
4248
def get_daemon_status():
4349
with open(RC) as f:
4450
for l in f:
@@ -71,6 +77,7 @@ def change_daemon(action):
7177

7278

7379
def main():
80+
validate_boot_file()
7481
status = get_daemon_status()
7582

7683
print("WebREPL daemon auto-start status:", "enabled" if status else "disabled")

0 commit comments

Comments
 (0)