From e025c8255f7b2592ba787fd4c373309a0f7bde48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferit=20Yi=C4=9Fit=20BALABAN?= Date: Thu, 24 Mar 2022 08:54:50 +0300 Subject: [PATCH] Add functionality: auto check out to main --- dotman.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/dotman.py b/dotman.py index aabff63..75f0851 100755 --- a/dotman.py +++ b/dotman.py @@ -10,7 +10,7 @@ from termcolor import colored, cprint DOTFILES_REPOSITORY = '$HOME/repos/dotfiles' -REMOTE_REPOSITORY = 'https://github.com/fybalaban/dotfiles' +REMOTE_REPOSITORY = 'https://github.com/fybx/dotfiles' LOCAL_CONFIG = '$HOME/.config' VER = 'v1.5' help_message = f''' @@ -86,9 +86,12 @@ def special_copy(source, dest): def commit_then_push(): - _, _ = proc('/usr/bin/git add .', DOTFILES_REPOSITORY) + # I forget checking out to main after testing on a seperate branch + # Line below checks out for me every time it's run + proc('/usr/bin/git checkout main', DOTFILES_REPOSITORY) + proc('/usr/bin/git add .', DOTFILES_REPOSITORY) date = dt.now().strftime('%d.%m.%Y %H.%M') - code, output = proc(f'/usr/bin/git commit -m "dotman {date}"', DOTFILES_REPOSITORY) + _, output = proc(f'/usr/bin/git commit -m "dotman {date}"', DOTFILES_REPOSITORY) if 'nothing to commit' not in output: code, output = proc('/usr/bin/git push', DOTFILES_REPOSITORY) return 0 if code == 0 else 2