Skip to content

Commit

Permalink
Add bash script to run download and execute cli
Browse files Browse the repository at this point in the history
  • Loading branch information
egorikftp committed Nov 25, 2024
1 parent 8cb2557 commit 93703ff
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 11 deletions.
45 changes: 34 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ material icons.
- [Installation](#installation)
- [Build plugin](#build-plugin)
- 🖥️ [CLI tool](#cli-tool)
- [Run CLI](#run-cli)
- [Install](#install-cli)
- [Available commands](#available-commands)
- [`iconpack` command](#iconpack-command)
- [`svgxml2imagevector` command](#svgxml2imagevector-command)
- [Build CLI](#build-cli)
- [Build](#build-cli)
- [Other](#other)
- [Export formats](#export-formats)
- [Comparison with other solutions](#comparison-with-other-solutions)
Expand Down Expand Up @@ -171,7 +171,9 @@ https://github.com/user-attachments/assets/1047a2b3-81ec-4e10-a118-0ff20bd5227b
- Android Studio Koala and later

> [!IMPORTANT]
> K2 mode is available starting from IntelliJ IDEA 2024.2.1 ([more details](https://kotlin.github.io/analysis-api/migrating-from-k1.html#declaring-compatibility-with-the-k2-kotlin-mode))
> K2 mode is available starting from IntelliJ IDEA
>
2024.2.1 ([more details](https://kotlin.github.io/analysis-api/migrating-from-k1.html#declaring-compatibility-with-the-k2-kotlin-mode))

### Installation

Expand Down Expand Up @@ -203,26 +205,48 @@ or run plugin in IDE using: `./gradlew runIde`
CLI tools can be easily integrated into scripts and automated workflows, allowing you to convert icons from specific
source with predefined settings.

### Run CLI
### Install CLI

Download latest CLI tool from [releases](https://github.com/ComposeGears/Valkyrie/releases) or [build](#build-cli) it by
yourself.
- #### manually via binary release

Download latest CLI tool from [releases](https://github.com/ComposeGears/Valkyrie/releases).

Unzip the downloaded archive and run the CLI tool from `bin` folder in the terminal

```shell
./valkyrie
```

<div align="center">
<img src="assets/cli_structure.png" width="450" />
</div>

You should see this message
<div align="center">
<img src="assets/cli_valkyrie.png" width="550" />
</div>

- #### automatically using bash script

A simple example of how to get the latest version of the CLI tool. It can be executed on CI/CD with predefined
parameters.

```shell

#!/bin/bash

TARGET_DIR="valkyrie-cli"
ASSET_NAME="tmp.zip"

LATEST_CLI_RELEASE_URL=$(curl --silent "https://api.github.com/repos/ComposeGears/Valkyrie/releases/latest" \
| jq -r '.assets[] | select(.name | startswith("valkyrie-cli")) | .browser_download_url')

curl -L -o "$ASSET_NAME" "$LATEST_CLI_RELEASE_URL"
mkdir -p "$TARGET_DIR"
unzip -o "$ASSET_NAME" -d "$TARGET_DIR"

rm "$ASSET_NAME"

cd "$TARGET_DIR/bin" || exit
./valkyrie svgxml2imagevector -h
```

### Available commands

#### `iconpack` command
Expand Down Expand Up @@ -566,7 +590,6 @@ See the License for the specific language governing permissions and
limitations under the License.
```


[badge:plugin-homepage]: https://img.shields.io/badge/Marketplace-Valkyrie-24786.svg?style=for-the-badge&labelColor=000000&color=FFFFFF

[badge:version]: https://img.shields.io/jetbrains/plugin/v/24786?style=for-the-badge&labelColor=000000&color=FFFFFF
Expand Down
Binary file removed assets/cli_structure.png
Binary file not shown.

0 comments on commit 93703ff

Please sign in to comment.