-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c48f023
commit 33f1f48
Showing
3 changed files
with
91 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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プロジェクトを探しに行きます。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |