Skip to content

Commit

Permalink
add arg yaml_path
Browse files Browse the repository at this point in the history
  • Loading branch information
wangye committed Aug 24, 2024
1 parent 95ce770 commit ab82d77
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import os
import re
import shutil
import sys
from pathlib import Path
from yaml import load, Loader

Expand Down Expand Up @@ -110,7 +111,7 @@ class Watcher:
startup: bool

def __init__(self):
stream = io.open("config.yaml", "r")
stream = io.open(yaml_path, "r")
config = load(stream, Loader)
self.name = config.get("name", "no name")
self.startup = config.get("startup", False)
Expand Down Expand Up @@ -160,4 +161,8 @@ def start(self):


if __name__ == '__main__':
if len(sys.argv) == 1:
yaml_path = "config.yaml"
else:
yaml_path = sys.argv[1]
Watcher().start()

0 comments on commit ab82d77

Please sign in to comment.