Fix dockerfile and reset Nu config to default (#13851)

<!--
if this PR closes one or more issues, you can automatically link the PR
with
them by using one of the [*linking
keywords*](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword),
e.g.
- this PR should close #xxxx
- fixes #xxxx

you can also mention related issues, PRs or discussions!
-->

# Description

Fix dockerfile and reset Nu config to default, fetching config file from
the remote may cause compatible issues
This commit is contained in:
Justin Ma 2024-09-15 20:03:22 +08:00 committed by GitHub
parent ebc7b80c23
commit c9cb62067c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -10,8 +10,6 @@ LABEL maintainer=nushell
RUN echo '/usr/bin/nu' >> /etc/shells \
&& adduser -D -s /usr/bin/nu nushell \
&& mkdir -p /home/nushell/.config/nushell/ \
&& wget -q https://raw.githubusercontent.com/nushell/nushell/main/crates/nu-utils/src/sample_config/default_config.nu -O /home/nushell/.config/nushell/config.nu \
&& wget -q https://raw.githubusercontent.com/nushell/nushell/main/crates/nu-utils/src/sample_config/default_env.nu -O /home/nushell/.config/nushell/env.nu \
&& cd /tmp \
&& wget -qO - https://api.github.com/repos/nushell/nushell/releases/latest \
| grep browser_download_url \
@ -23,6 +21,8 @@ RUN echo '/usr/bin/nu' >> /etc/shells \
&& mv nu* /usr/bin \
&& chmod +x /usr/bin/nu \
&& chown -R nushell:nushell /home/nushell/.config/nushell \
# Reset Nushell config to default
&& su -c 'config reset -w' nushell \
&& ls /usr/bin/nu_plugin* \
| xargs -I{} su -c 'plugin add {}' nushell \
&& rm -rf /tmp/*