Skip to content

Commit

Permalink
Merge pull request #140 from davidtaylorhq/macos
Browse files Browse the repository at this point in the history
add support for chia installed via macOS dmg installer
  • Loading branch information
altendky authored Apr 22, 2021
2 parents 3cf08ae + 7004100 commit bd6a32b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,14 @@ To display the current location of your `plotman.yaml` file and check if it exis

## Installation

Installation for Linux:
Installation for Linux and macOS:

1. Plotman assumes that a functioning [Chia](https://github.com/Chia-Network/chia-blockchain)
installation is present on the system. Activate your `chia` environment by typing
`source /path/to/your/chia/install/activate`.
installation is present on the system.
- virtual environment (Linux, macOS): Activate your `chia` environment by typing
`source /path/to/your/chia/install/activate`.
- dmg (macOS): Follow [these instructions](https://github.com/Chia-Network/chia-blockchain/wiki/CLI-Commands-Reference#mac)
to add the `chia` binary to the `PATH`
2. Then, install Plotman using the following command:
```shell
> pip install --force-reinstall git+https://github.com/ericaltendorf/plotman@main
Expand Down
22 changes: 12 additions & 10 deletions src/plotman/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@ def job_phases_for_dstdir(d, all_jobs):
return sorted([j.progress() for j in all_jobs if j.dstdir == d])

def is_plotting_cmdline(cmdline):
if cmdline and 'python' in cmdline[0].lower():
cmdline = cmdline[1:]
return (
len(cmdline) >= 4
and 'python' in cmdline[0].lower()
and cmdline[1].endswith('/chia')
and 'plots' == cmdline[2]
and 'create' == cmdline[3]
len(cmdline) >= 3
and cmdline[0].endswith("chia")
and 'plots' == cmdline[1]
and 'create' == cmdline[2]
)

# This is a cmdline argument fix for https://github.com/ericaltendorf/plotman/issues/41
Expand Down Expand Up @@ -104,12 +105,13 @@ def __init__(self, proc, logroot):
with self.proc.oneshot():
# Parse command line args
args = self.proc.cmdline()
if 'python' in args[0].lower():
args = args[1:]
assert len(args) > 4
assert 'python' in args[0].lower()
assert 'chia' in args[1]
assert 'plots' == args[2]
assert 'create' == args[3]
args_iter = iter(cmdline_argfix(args[4:]))
assert 'chia' in args[0]
assert 'plots' == args[1]
assert 'create' == args[2]
args_iter = iter(cmdline_argfix(args[3:]))
for arg in args_iter:
val = None if arg in {'-e', '--nobitfield', '-h', '--help', '--override-k'} else next(args_iter)
if arg in {'-k', '--size'}:
Expand Down

0 comments on commit bd6a32b

Please sign in to comment.