Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 45 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1177,6 +1177,48 @@ plus a lot of diagnostic info, so you might want to use it to troubleshoot weird
and/or crashes.


### Install autocompletions for `bash`

You can just add this to your `.bashrc`:

```bash
source <(spago --bash-completion-script `which spago`)
```

or alternatively if you don't want to edit your `~/.bashrc`:

```bash
spago --bash-completion-script $(which spago) >> ~/.bash_completion
```

### Install autocompletions for `zsh`

Autocompletions for `zsh` need to be somewhere in the `fpath` - you can see the folders
included in your by running `echo $fpath`.

You can also make a new folder - e.g. `~/.my-completions` - and add it to the `fpath`
by just adding this to your `~/.zshrc`:

```bash
fpath=(~/.my-completions $fpath)
```

Then you can obtain the completion definition for zsh and put it in a file called
`_spago` [(yes it needs to be called like that)](https://github.com/zsh-users/zsh-completions/blob/master/zsh-completions-howto.org#telling-zsh-which-function-to-use-for-completing-a-command):

```bash
spago --zsh-completion-script $(which spago) > ~/.my-completions/_spago
```

Then, reload completions with:

```bash
compinit
```

*Note*: you might need to call this multiple times for it to work.


### Ignore or update the global cache

There is a global cache that `spago` uses to avoid re-downloading things - its
Expand All @@ -1192,9 +1234,9 @@ that is accepted by many commands. You can either:

### Know the output path for my compiled code

As there are now various factors that can affect the output path of compiled code, run
`spago path output` along with any flags you would pass to `spago build` (like
`--purs-args` or `--no-share-output`) to return the output path Spago is using.
As there are now various factors that can affect the output path of compiled code, run
`spago path output` along with any flags you would pass to `spago build` (like
`--purs-args`) to return the output path Spago is using.
This can be useful for sharing an output folder with `webpack`, for instance.

## Explanations
Expand Down