# Available Scripts

The script `index.js` file in `/src` exposes the following commands:

## `build <source> <output>`
Builds the svg sprite <br>
> `source`: 'a vinyl pattern of svg files to include - i.e: "svg/*.svg"',<br>
> `output`: 'an output directory'

### options:
the `build` script accepts the following options :
- `-f, --fill <keep|strip>`: fill attribute behavior (defaults to `Build_fill` in `.env` and ultimately to 'strip')<br>
- `-d, --dist <path>`: dist path (building output directory). <br>
- `-l, --log <level>`: log level (defaults to `Build_log` in `.env`)<br>

### example
```shell
node src/index.js build 'svg/*.svg' dist
```

## `add|add-all <sprite_id> <svg_path>`
add an svg to the target sprite <br>
> `sprite_id`: the sprite id,<br>
> `svg_path`: the path to the svg, accepts wildcard ('*.svg')<br>

### options
the `add` script accepts the following options :
- `--id <svgId>`: svg id in sprite (defaults to removing diacritics in file name)<br>

### examples
```shell
node src/index.js add desygner ~/Downloads/icon.svg
```

```shell
node src/index.js add-all desygner ~/Downloads/icons/'*.svg'
```

### `publish <sprite_id>` (alias `deploy <sprite_id>`)

publish the passed sprite <br>
> `sprite_id`: the sprite id,<br>

### options
the `publish` script accepts the following options :
-  ... all the options of the build command <br>
- `--overwriteVersion <version>` publish to a version different than the configuration one<br>
- `-f, --force` force publish without safety checks<br>
- `-id, --accessKeyId <accessKeyId>` your AWS access key id (defaults to `AWS_accessKeyId` in `.env`)
- `-key, --secretAccessKey <secretAccessKey>` your AWS secret access key (defaults to `AWS_secretAccessKey` in `.env`)

### examples
```shell
node src/index.js publish desygner
```