Skip to content

Commit

Permalink
READMEを作成する
Browse files Browse the repository at this point in the history
  • Loading branch information
higumachan committed Dec 13, 2023
1 parent c48f023 commit 33f1f48
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/target
/test-environment/Dockerfile
README.ja.md
README.md
.dockerignore
.git
.gitignore
56 changes: 56 additions & 0 deletions README.ja.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Cargo Cleaner

[cargo-clean-all](https://crates.io/crates/cargo-clean-all)にインスパイアされたTUI製のcargoのtargetファイルの削除ツールです。

TUI画面でcargo projectを選択して一括でtargetディレクトリの削除(cargo clean相当)を実行することができます。

# インストール方法

## cargo install

```bash
cargo install cargo-cleaner
```

# 使い方

## シンプルな使い方

```bash
cargo cleaner
```

この方法で起動すると、cargo-cleanerはHOMEディレクトリ以下の全てのディレクトリを対象に、targetディレクトリが正のサイズを持つCargoプロジェクトを探しに行きます。

## key-bind

| key | description |
|---------|-------------------|
| `h` | ヘルプの表示 |
| `j` or ↓ | 下に移動 |
| `k` or ↑ | 上に移動 |
| `g` | リストの先頭に移動 |
| `G` | リストの末尾に移動 |
| `SPACE` | カーソルのあるファイルを選択/解除 |
| `v` | 自動選択モードに切り替える |
| `V` | 自動選択解除モードに切り替える |
| `ESC` | モードの解除 |
| `d` | 選択したファイルを削除 |
| `q` | 終了 |


## dry-run

```bash
cargo cleaner --dry-run
```

dry-runを指定すると、実際に削除を行わずに、削除対象となるファイルを表示します。

## Specify the directory

```bash
cargo cleaner -r <directory>
```

-rオプションを指定すると、指定したディレクトリ以下の全てのディレクトリを対象に、targetディレクトリが正のサイズを持つCargoプロジェクトを探しに行きます。
28 changes: 28 additions & 0 deletions test-environment/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM rust:1-bookworm as builder

COPY ./ /app

WORKDIR /app
RUN cargo build --release
RUN apt install -y git
RUN mkdir /repos
WORKDIR /repos
RUN git clone https://github.com/rust-lang/cargo.git
RUN cd cargo && cargo build
RUN cargo new alice && cd alice && cargo build
RUN cargo new bob && cd bob && cargo build
RUN cargo new carol && cd carol && cargo build
RUN cargo new dave && cd dave && cargo build
RUN cargo new eve && cd eve && cargo build
RUN cargo new kuma && cd kuma && cargo build

FROM debian:bookworm-slim
RUN mkdir /app
COPY --from=builder /app/target/release/cargo-cleaner /app/cargo-cleaner
COPY --from=builder /repos/cargo /root/cargo
COPY --from=builder /repos/alice /root/alice
COPY --from=builder /repos/bob /root/bob
COPY --from=builder /repos/carol /root/carol
COPY --from=builder /repos/dave /root/dave
COPY --from=builder /repos/eve /root/eve
COPY --from=builder /repos/kuma /root/kuma

0 comments on commit 33f1f48

Please sign in to comment.