Skip to content

Commit

Permalink
fix issue with .gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
baileywickham committed Nov 25, 2021
1 parent b432bf8 commit 819f8d4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
5 changes: 1 addition & 4 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
awk -F= '{if ($1 =="__version__") print substr($0,0, 17 $1=$2}' secretm/__init__.py | awk -F. '{print ++$3}'
rm -rf dist
python3 -m build
python3 -m twine upload dist/*
poetry build
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description = ""
authors = ["baileywickham <[email protected]>"]

[tool.poetry.dependencies]
python = "^3.8"
python = "^3.10"
PyYAML = "^6.0"
pycryptodome = "^3.11.0"

Expand Down
15 changes: 7 additions & 8 deletions secretm/secretm.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import yaml
import string
import random
import os
import urllib.request
from pathlib import Path
from typing import Optional, Any

from Crypto.PublicKey import RSA
from Crypto.Cipher import AES, PKCS1_OAEP
from Crypto.Random import get_random_bytes

def resolvePath(path: str) -> str:
def resolvePath(path: str) -> Path:
return Path(path).expanduser().resolve()

class Model(dict):
Expand All @@ -20,21 +19,21 @@ class Model(dict):
class Secrets(Model):
def __init__(self, datafile="secrets",
gh_user='baileywickham',
public_key_file=None,
private_key_file='~/.ssh/id_rsa',
public_key_file:str=None,
private_key_file:str='~/.ssh/id_rsa',
public_key=None,
private_key=None):
self.datafile : str = datafile
self.datafile_enc : str = datafile + '.enc'

self.gh_user : str = gh_user
self.public_key_file : str = public_key_file
self.public_key_file : Optional[str] = public_key_file
self.private_key_file : str = private_key_file

self.public_key : RSA = public_key
self.private_key : RSA = private_key

self.secrets = {}
self.secrets: dict[str, Any] = {}

self.addToGitignore()

Expand Down Expand Up @@ -72,7 +71,7 @@ def addToGitignore(self) -> None:
with open(".gitignore", "a+") as f:
f.seek(0)
for line in f:
if self.path == line.strip("\n"):
if self.datafile == line.strip("\n"):
break
else:
f.write(self.datafile + '\n')
Expand Down

0 comments on commit 819f8d4

Please sign in to comment.