Update desktop readme, and add a helper script to use CLI args

This commit is contained in:
Micah Lee 2020-11-29 11:23:23 -08:00
parent 343834e7af
commit c904bb5b5f
No known key found for this signature in database
GPG Key ID: 403C2657CD994F73
3 changed files with 22 additions and 2 deletions

View File

@ -51,7 +51,7 @@ Download Tor Browser and extract the binaries:
python scripts\get-tor-windows.py
```
### Prepare the code
### Prepare the virtual environment
OnionShare uses [Briefcase](https://briefcase.readthedocs.io/en/latest/).
@ -82,12 +82,22 @@ In order to work with the desktop app, you'll need to build a wheel of the CLI p
./scripts/rebuild-cli.sh
```
Run OnionShare from the source tree like this:
### Running OnionShare from the source code tree
Inside the virtual environment, run OnionShare like this to install all of the dependencies:
```
briefcase dev -d
```
Once you have the dependencies installed, you can run it using the `dev.sh` script, which lets you use command line arguments, such as to `--verbose` or `--local-only`:
```
./scripts/dev.sh --help
./scripts/dev.sh -v
./scripts/dev.sh -v --local-only
```
## Running tests
Install these packages inside your virtual environment:

9
desktop/scripts/dev.sh Executable file
View File

@ -0,0 +1,9 @@
#!/bin/bash
# Run OnionShare desktop, allowing you to use command-line arguments
SCRIPTS_DIR="$( cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd )"
cd $SCRIPTS_DIR
cd ../src
python -c "import onionshare; onionshare.main()" $@

View File

@ -5,5 +5,6 @@
SCRIPTS_DIR="$( cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd )"
cd $SCRIPTS_DIR
cd ../../cli
poetry install
poetry build
cp dist/*.whl ../desktop