Files
archmgr/commands/init.py
T

20 lines
685 B
Python

import os
import commands.util.git as git
def init(force: bool = False):
dir = os.getcwd()
if force:
[os.remove(dir) for dir in os.listdir(dir)]
git.init(dir)
os.mkdir(dir + "/config")
os.mkdir(dir + "/etc")
with open(dir + "/config.yaml") as file:
file.write("")
print("Initialized a new archmgr repository")
# TODO: Warn user to not delete .config/archmgr repo
# TODO: Set up that repo (where to put it? /usr/share?)
# TODO: Consider collecting function
# TODO: Config folder instead of single config file
# TODO: Also store the folder name of the config folder in that repo (needs to be easily changeable for user!)