update-applications/update_applications/__main__.py

24 lines
578 B
Python
Raw Permalink Normal View History

2024-06-07 10:55:03 +00:00
import argparse
import datetime
import subprocess
from pathlib import Path
2024-06-07 10:23:37 +00:00
from .__about__ import __version__
2024-06-07 10:55:03 +00:00
from .utils import (CONFIG_PATH, SETTINGS, SETTINGS_EXISTED, console,
edit_file, load_config, save_config)
def configure():
save_config()
edit_file(CONFIG_PATH)
load_config()
2024-06-07 10:23:37 +00:00
def cli():
2024-06-07 10:55:03 +00:00
parser = argparse.ArgumentParser()
parser.add_argument("--config", action=argparse.BooleanOptionalAction, help="Configure the settings")
args = parser.parse_args()
if not SETTINGS_EXISTED or args.config:
configure()