Skip to content

Commit

Permalink
Add Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
mrfelton committed Apr 8, 2024
1 parent 73b1118 commit 48b0dc7
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 21 deletions.
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.PHONY: build test

build:
pyinstaller --clean --noconfirm schwifty.spec

test:
@$(DEVENV_ROOT)/.venv/bin/python $(DEVENV_ROOT)/schwifty-cli/__main__.py "DE89370400440532013000" | jq '.'

test-binary:
@$(DEVENV_ROOT)/dist/schwifty "DE89370400440532013000" | jq '.'
19 changes: 8 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,30 @@ git clone https://github.com/LN-Zap/schwifty-cli.git
cd schwifty-cli
```

If you have [`devenv`](https://devenv.sh/) and [`direnv`](https://direnv.net/) setup, the Schwifty development environment should activate automatically on entering the project directory. If not, install those dependencies.

## Development

To run the Schwifty CLI in development mode (direct from the source code in the `schwifty-cli` directory), use the following command in the terminal:
```bash
schwifty-src [IBAN]
```
If you have [`devenv`](https://devenv.sh/) and [`direnv`](https://direnv.net/) setup, the Schwifty development environment should activate automatically on entering the project directory. If not, install those dependencies. Alternativly, install the Python and Poetry project dependencies.

## Build

To build the Schwifty CLI (using PyInstaller), run the following command in the terminal:

```
build
```bash
make build
```

## Test

To run the tests for the Schwifty CLI, use the following command in the terminal:

```bash
devenv test
make test
```

## Usage

To run the Schwifty CLI direct from the source code, run the following command in the terminal:
```bash
schwifty-src [IBAN]
```

To use the Schwifty CLI, run the following command in the terminal:

Expand Down
12 changes: 2 additions & 10 deletions devenv.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,11 @@
];

enterTest = ''
build
tree build -L 3
tree dist -L 3
echo "testing source..."
schwifty-src "DE89370400440532013000" | jq '.'
# echo "testing binary..."
# schwifty "DE89370400440532013000" | jq '.'
make build
make test
'';

# https://devenv.sh/scripts/
scripts.build.exec = "pyinstaller --clean --noconfirm schwifty.spec";
scripts.schwifty.exec = "$DEVENV_ROOT/dist/schwifty $@";
scripts.schwifty-src.exec = "$DEVENV_ROOT/.venv/bin/python $DEVENV_ROOT/schwifty-cli/__main__.py $@";

Expand Down

0 comments on commit 48b0dc7

Please sign in to comment.