Skip to content

Commit

Permalink
switch to pypi only
Browse files Browse the repository at this point in the history
  • Loading branch information
ayham-1 committed Sep 28, 2024
1 parent d604c83 commit 9dbdaf8
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 6 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ partitions. This script helps automate the configuration of encrypted `/boot`.
And provides a solution in replacement of the `/efi` partition, which usually
can not be encrypted, by having it be present on a USB DONGLE.

## Installation

```sh
pipx install donglify
```

## Usage

To use donglify, you will need to install the initial configurations onto a
Expand Down
14 changes: 14 additions & 0 deletions dev.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh
tmux new-session -s donglify -n code -d

tmux new-window -t donglify:2 -n run
tmux new-window -t donglify:3 -n files
tmux new-window -t donglify:4 -n git
tmux new-window -t donglify:5 -n kanban

tmux send-keys -t 'files' 'man tmux' Enter
tmux send-keys -t 'git' 'git log' Enter
tmux send-keys -t 'kanban' 'taskell' Enter

tmux select-window -t donglify:1
tmux -2 attach-session -t donglify
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "donglify"
version = "20240124"
version = "20240929"
dependencies = [
'termcolor',
'prompt_toolkit'
Expand Down
4 changes: 2 additions & 2 deletions quick_build.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
rm -fr dist
.venv/bin/python3 -m build && .venv/bin/python3 -m pip install dist/*.whl --force-reinstall
hatch clean
hatch build
4 changes: 4 additions & 0 deletions quick_run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

pip3 install --editable .
donglify $@
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hatch
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
termcolor
prompt_toolkit
11 changes: 8 additions & 3 deletions src/donglify/donglify.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
from donglify.grub import *
from donglify.isos import *

import importlib.metadata

version = importlib.metadata.version("donglify")


def dongle_init_partition(dev_name):
print(colored(f"Acknowledge that the following procedure *will* destroy ALL data on '{dev_name}'\n"
Expand All @@ -28,7 +32,7 @@ def dongle_init_partition(dev_name):
print("Farewell.")
sys.exit(0)

cmd = f'parted {dev_name} mklabel gpt'
cmd = f'sudo parted {dev_name} mklabel gpt'
execute(cmd, desc="set USB partition table as GPT")

cmd = f'lsblk -n -oNAME,SIZE {dev_name}'
Expand Down Expand Up @@ -218,8 +222,9 @@ def dongle_safe_update():


def main():
usage = "Usage: donglify /dev/<name of usb>[index of encrypted dongleboot]\n" + \
" donglify init /dev/<name of usb>"
usage = f"Version: {version}\n" + \
"Usage: donglify /dev/<name of usb>[index of encrypted dongleboot]\n" + \
" donglify init /dev/<name of usb>"

if len(sys.argv) == 3 and "init" == sys.argv[1] and '/dev/' in sys.argv[2] and len(sys.argv[2]) == len('/dev/xyz'):
dongle_init_partition(sys.argv[2])
Expand Down

0 comments on commit 9dbdaf8

Please sign in to comment.