Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add morsed command #124

Merged
merged 2 commits into from Nov 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 11 additions & 1 deletion Dockerfile
Expand Up @@ -133,7 +133,7 @@ RUN nimble install edens gyaric maze rect svgo eachdo -Y
FROM base AS general-builder
RUN --mount=type=bind,target=/var/lib/apt/lists,from=apt-cache,source=/var/lib/apt/lists \
--mount=type=cache,target=/var/cache/apt,sharing=private \
apt-get install -y -qq lib32ncursesw5-dev
apt-get install -y -qq lib32ncursesw5-dev jq

WORKDIR /downloads
# Open-usp-Tukubai
Expand Down Expand Up @@ -185,6 +185,11 @@ RUN curl -sfSL --retry 5 https://github.com/PowerShell/PowerShell/releases/downl
RUN curl -sfSLO --retry 5 https://github.com/vlang/v/releases/download/0.1.24/v_linux.zip
## use prefetched file
COPY prefetched/chrome-linux.zip .
# morsed (最新版のreleasesを取得するためjqで最新タグを取得)
RUN curl -s https://api.github.com/repos/jiro4989/morsed/releases \
| jq -r '.[0].assets[] | select(.name | test("morsed_linux.tar.gz")) | .browser_download_url' \
| xargs curl -sfSLO --retry 5

WORKDIR /


Expand Down Expand Up @@ -440,6 +445,11 @@ RUN --mount=type=bind,target=/downloads,from=general-builder,source=/downloads \
&& tar xf /downloads/powershell.tar.gz -C /usr/local/powershell \
&& ln -s /usr/local/powershell/pwsh /usr/local/bin/

# morsed
RUN --mount=type=bind,target=/downloads,from=general-builder,source=/downloads \
tar xf /downloads/morsed_linux.tar.gz -C /usr/local/ \
&& ln -s /usr/local/morsed_linux/morsed /usr/local/bin/

# man
RUN mv /usr/bin/man.REAL /usr/bin/man

Expand Down
6 changes: 6 additions & 0 deletions docker_image.bats
Expand Up @@ -1080,3 +1080,9 @@
run bash -c "echo J+KBouKAjeKAi+KBouKAjeKAi+KAi+KAjeKAjeKBouKAjOKBouKBouKAjeKAi+KBouKAjeKAi+KAi+KAjeKAjeKAjeKAjOKBouKBouKAjeKAi+KBouKAjeKAi+KAi+KBouKAjeKAjeKAjeKBouKBouKAjeKAjeKAi+KAjeKAi+KAjeKAjeKAjeKBouKAjeKAi+KAi+KAi+KAjeKAjScK | base64 -d | zws -d"
[ "$output" = 'シェル芸' ]
}

@test "morsed" {
run bash -c "morsed -p 名詞 -s 寿司 吾輩は猫である"
[ "$output" = "寿司は寿司である" ]
}