Skip to content
This repository has been archived by the owner on Jan 7, 2024. It is now read-only.

Commit

Permalink
fix: bug fixes, add status command
Browse files Browse the repository at this point in the history
  • Loading branch information
bsecker committed Aug 29, 2021
1 parent f436cd5 commit d3e3103
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ Edit the credentials file to add a secret passsword used for decrypting your Jou

Alias for git log, with some pretty graph options.

### status

Runs `git status`. Basically just a convenience function, so you don't have to `cd` into a wiki dir.

### commit

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "seckerwiki"
version = "2.0.4"
version = "2.0.5"
description = "A collection of scripts used to manage my personal Foam workspace"
authors = ["Benjamin Secker <[email protected]>"]
repository = "https://github.com/bsecker/wiki/"
Expand Down
6 changes: 5 additions & 1 deletion seckerwiki/commands/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@
import subprocess
from PyInquirer import prompt

def status(cfg, args):
subprocess.run(['git', 'status'])

# Commit command
def commit(cfg, args):
"""
Commit the files
args:
-y : don't confirm
-a, --add: add all unstaged files
"""

def convert(line):
Expand All @@ -30,7 +34,7 @@ def convert(line):
return

if args.add:
subprocess.run(['git','add','-all'])
subprocess.run(['git','add','--all'])

# Make a message using the filenames. If its too long,
# Set the commit title to the root folders, then the commit description to each of the files changed
Expand Down
7 changes: 5 additions & 2 deletions seckerwiki/wiki.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import yaml

from seckerwiki.commands.lecture import lecture
from seckerwiki.commands.git import commit, log, sync
from seckerwiki.commands.git import commit, log, sync, status
from seckerwiki.commands.receipt import receipt
from seckerwiki.commands.journal import journal
from seckerwiki.commands.setup import setup
Expand Down Expand Up @@ -33,9 +33,12 @@ def main():
log_parser = subparsers.add_parser('log', help='show git log')
log_parser.set_defaults(func=log)

status_parser = subparsers.add_parser('status', help='show git status')
status_parser.set_defaults(func=status)

commit_parser = subparsers.add_parser('commit', help='commit wiki')
commit_parser.add_argument('-y', action='store_true', help='Don\'t ask for confirmation before committing')
commit_parser.add_argument('-a', action='store_true', help='Add all modified and unstaged files not gitignored')
commit_parser.add_argument('-a', '--add', action='store_true', help='Add all modified and unstaged files not gitignored')
commit_parser.set_defaults(func=commit)

sync_parser = subparsers.add_parser('sync', help='sync with remote repo')
Expand Down

0 comments on commit d3e3103

Please sign in to comment.