Skip to content

Commit a51ecf3

Browse files
committed
combined multiple sed calls for zsh configuration into one call
1 parent 7f3d107 commit a51ecf3

File tree

5 files changed

+27
-12
lines changed

5 files changed

+27
-12
lines changed

.devcontainer/debian/12-bookworm/Dockerfile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -554,9 +554,13 @@ RUN echo "ZSH" && \
554554
git clone --depth=1 --no-tags https://github.com/zsh-users/zsh-completions ${ZSH_CUSTOM:=~/.oh-my-zsh/custom}/plugins/zsh-completions && \
555555
git clone --depth=1 --no-tags https://github.com/zsh-users/zsh-history-substring-search ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-history-substring-search && \
556556
# Update .zshrc
557-
sed -i "s/plugins=(git)/plugins=(git zsh-completions zsh-autosuggestions zsh-history-substring-search)/" /root/.zshrc && \
558-
sed -i "s/ZSH_THEME=\"agnoster\"/ZSH_THEME=\"robbyrussell\"/" /root/.zshrc && \
559-
# Cleanup
557+
sed -i \
558+
-e 's/^plugins=(git.*)/plugins=(git zsh-completions zsh-autosuggestions zsh-history-substring-search)/' \
559+
-e 's/^ZSH_THEME="[^"]*"/ZSH_THEME="robbyrussell"/' \
560+
-e 's/^# *DISABLE_UPDATE_PROMPT="true"/DISABLE_UPDATE_PROMPT="true"/' \
561+
-e 's/^# *DISABLE_AUTO_UPDATE="true"/DISABLE_AUTO_UPDATE="true"/' \
562+
/root/.zshrc && \
563+
# Cleanup
560564
apt-get autoremove -y && \
561565
apt-get clean autoclean && \
562566
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

.devcontainer/debian/13-trixie/Dockerfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -576,9 +576,12 @@ RUN echo "ZSH" && \
576576
git clone --depth=1 --no-tags https://github.com/zsh-users/zsh-completions ${ZSH_CUSTOM:=~/.oh-my-zsh/custom}/plugins/zsh-completions && \
577577
git clone --depth=1 --no-tags https://github.com/zsh-users/zsh-history-substring-search ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-history-substring-search && \
578578
# Update .zshrc
579-
sed -i "s/plugins=(git)/plugins=(git zsh-completions zsh-autosuggestions zsh-history-substring-search)/" /root/.zshrc && \
580-
sed -i "s/ZSH_THEME=\"agnoster\"/ZSH_THEME=\"robbyrussell\"/" /root/.zshrc && \
581-
sed -i "s/# DISABLE_AUTO_UPDATE=\"true\"/DISABLE_AUTO_UPDATE=\"true\"/" /root/.zshrc && \
579+
sed -i \
580+
-e 's/^plugins=(git.*)/plugins=(git zsh-completions zsh-autosuggestions zsh-history-substring-search)/' \
581+
-e 's/^ZSH_THEME="[^"]*"/ZSH_THEME="robbyrussell"/' \
582+
-e 's/^# *DISABLE_UPDATE_PROMPT="true"/DISABLE_UPDATE_PROMPT="true"/' \
583+
-e 's/^# *DISABLE_AUTO_UPDATE="true"/DISABLE_AUTO_UPDATE="true"/' \
584+
/root/.zshrc && \
582585
# Cleanup
583586
apt-get autoremove -y && \
584587
apt-get clean autoclean && \

.devcontainer/debian/14-forky/Dockerfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -582,9 +582,12 @@ RUN echo "ZSH" && \
582582
git clone --depth=1 --no-tags https://github.com/zsh-users/zsh-completions ${ZSH_CUSTOM:=~/.oh-my-zsh/custom}/plugins/zsh-completions && \
583583
git clone --depth=1 --no-tags https://github.com/zsh-users/zsh-history-substring-search ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-history-substring-search && \
584584
# Update .zshrc
585-
sed -i "s/plugins=(git)/plugins=(git zsh-completions zsh-autosuggestions zsh-history-substring-search)/" /root/.zshrc && \
586-
sed -i "s/ZSH_THEME=\"agnoster\"/ZSH_THEME=\"robbyrussell\"/" /root/.zshrc && \
587-
sed -i "s/# DISABLE_AUTO_UPDATE=\"true\"/DISABLE_AUTO_UPDATE=\"true\"/" /root/.zshrc && \
585+
sed -i \
586+
-e 's/^plugins=(git.*)/plugins=(git zsh-completions zsh-autosuggestions zsh-history-substring-search)/' \
587+
-e 's/^ZSH_THEME="[^"]*"/ZSH_THEME="robbyrussell"/' \
588+
-e 's/^# *DISABLE_UPDATE_PROMPT="true"/DISABLE_UPDATE_PROMPT="true"/' \
589+
-e 's/^# *DISABLE_AUTO_UPDATE="true"/DISABLE_AUTO_UPDATE="true"/' \
590+
/root/.zshrc && \
588591
# Cleanup
589592
apt-get autoremove -y && \
590593
apt-get clean autoclean && \

.devcontainer/debian/sid-unstable/Dockerfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -577,9 +577,12 @@ RUN echo "ZSH" && \
577577
git clone --depth=1 --no-tags https://github.com/zsh-users/zsh-completions ${ZSH_CUSTOM:=~/.oh-my-zsh/custom}/plugins/zsh-completions && \
578578
git clone --depth=1 --no-tags https://github.com/zsh-users/zsh-history-substring-search ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-history-substring-search && \
579579
# Update .zshrc
580-
sed -i "s/plugins=(git)/plugins=(git zsh-completions zsh-autosuggestions zsh-history-substring-search)/" /root/.zshrc && \
581-
sed -i "s/ZSH_THEME=\"agnoster\"/ZSH_THEME=\"robbyrussell\"/" /root/.zshrc && \
582-
sed -i "s/# DISABLE_AUTO_UPDATE=\"true\"/DISABLE_AUTO_UPDATE=\"true\"/" /root/.zshrc && \
580+
sed -i \
581+
-e 's/^plugins=(git.*)/plugins=(git zsh-completions zsh-autosuggestions zsh-history-substring-search)/' \
582+
-e 's/^ZSH_THEME="[^"]*"/ZSH_THEME="robbyrussell"/' \
583+
-e 's/^# *DISABLE_UPDATE_PROMPT="true"/DISABLE_UPDATE_PROMPT="true"/' \
584+
-e 's/^# *DISABLE_AUTO_UPDATE="true"/DISABLE_AUTO_UPDATE="true"/' \
585+
/root/.zshrc && \
583586
# Cleanup
584587
apt-get autoremove -y && \
585588
apt-get clean autoclean && \

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
- "It was a bright day in April, and the clocks were striking thirteen." - 1984
1313

14+
- combined zsh configuration commands using sed
15+
1416
## [1.0.15] - 2025-10-14
1517

1618
**Added**

0 commit comments

Comments
 (0)