+ partially implement method deploy()
This commit is contained in:
parent
2b6004a7b3
commit
3c2a10ce3c
11
dotman.py
11
dotman.py
@ -2,7 +2,8 @@
|
|||||||
#
|
#
|
||||||
# Ferit Yiğit BALABAN <f@fybx.dev>, 2023
|
# Ferit Yiğit BALABAN <f@fybx.dev>, 2023
|
||||||
#
|
#
|
||||||
import os.path
|
import os
|
||||||
|
import shlex
|
||||||
from subprocess import run
|
from subprocess import run
|
||||||
import sys
|
import sys
|
||||||
from datetime import datetime as dt
|
from datetime import datetime as dt
|
||||||
@ -196,9 +197,11 @@ def deploy():
|
|||||||
Kindly executes the steps to get a up-to-date local repository,
|
Kindly executes the steps to get a up-to-date local repository,
|
||||||
deploy (copy) files and directories to the local config directory.
|
deploy (copy) files and directories to the local config directory.
|
||||||
"""
|
"""
|
||||||
# if no local repo
|
if not os.path.exists(SETTINGS.DIR_REPO):
|
||||||
# go to ../local_repo and clone remote_url
|
r = SETTINGS.DIR_REPO
|
||||||
# go to local_repo and exec git fetch && git pull
|
r.removesuffix("/")[:r.removesuffix("/").rindex("/")]
|
||||||
|
run(shlex.split(f"/usr/bin/git clone {SETTINGS[URL_REPO]}"), text=True, cwd=r)
|
||||||
|
run(shlex.split("/usr/bin/git pull"))
|
||||||
# copy files & directories
|
# copy files & directories
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user