Skip to content

Commit

Permalink
Merge pull request #2 from mdmmn378/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
mdmmn378 authored Feb 8, 2024
2 parents 80b3e32 + 61a1f95 commit 8e44ce1
Show file tree
Hide file tree
Showing 17 changed files with 643 additions and 75 deletions.
5 changes: 5 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
HELLO=string
TAYLOR=string
AGE=int
SCORE=float
ACTIVE=bool
21 changes: 21 additions & 0 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: CD

on:
workflow_dispatch:

env:
CARGO_TERM_COLOR: always
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

jobs:
publish:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: katyo/publish-crates@v2
with:
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
25 changes: 25 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: CI

on:
push:
branches: ["master"]
pull_request:
branches: ["master"]
workflow_dispatch:

env:
CARGO_TERM_COLOR: always

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: actions-rs/cargo@v1
with:
command: build
args: --release --all-features
187 changes: 183 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 11 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
[package]
name = "envy"
version = "0.3.0"
name = "envy-mask"
version = "0.4.0"
edition = "2021"
authors = ["Mamun <mdmmn378@gmail.com>"]

[[bin]]
name = "envy"
path = "src/main.rs"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]

clap = { version = "4.4.14", features = ["derive"] }
colored = "2.1.0"
indexmap = "2.1.0"
anyhow = "1.0.79"
assert_cmd = "2.0.13"
toml = "0.8.10"
31 changes: 16 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,36 @@
# envy - A `.env` Example Generator
# envy - A Config File Example Generator

This project is a Rust-based tool that generates `.env` example files from existing `.env` files. It's useful for creating template environment files without exposing sensitive information.
---

## Features
![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/mdmmn378/envy-rs/ci.yaml)

- Reads `.env` files and generates `.env.example` files.
- Supports `.env` file format.
- Removes comments and cleans up the text in the `.env` files.
Envy is a tool that generates example configuration files from your existing `.env` or `.toml` files. It masks sensitive information and helps you maintain up-to-date example configuration files for your projects.

![Example](./docs/example.gif)

## Installation

Install the binary with the following command -
Install the binary with the following command:

```sh
cargo install --path .
```

## Usage

The main command for the tool is `generate`, which requires the path to the `.env` file as an argument.
The main command for the tool is `generate`, which requires the path to the `.env` or `.toml` file as an argument.

```sh
envy generate path/to/.env
```

This will generate a `.env.example` file in the same directory as the `.env` file.
or

```sh
envy generate path/to/config.toml
```

This will generate a `.env.example` or `example.toml` file in the current directory.

## Development

Expand All @@ -48,9 +54,4 @@ Pull requests are welcome. For major changes, please open an issue first to disc

## License

[MIT](https://choosealicense.com/licenses/mit/)

```
Please replace the license link with the actual link to your license file if you're not using the MIT license.
```
[MIT](MIT-LICENSE.txt)
Binary file added docs/example.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 8e44ce1

Please sign in to comment.