File tree Expand file tree Collapse file tree 5 files changed +39
-0
lines changed Expand file tree Collapse file tree 5 files changed +39
-0
lines changed Original file line number Diff line number Diff line change 3535 apk update || true
3636 # Use --allow-untrusted since the apk package is not signed currently
3737 apk add --allow-untrusted nushell
38+ cat /etc/shells
3839 nu -c '$nu.current-exe | print; version'
3940
4041 install-rpm :
6667 gpgkey=https://yum.fury.io/nushell/gpg.key" | tee /etc/yum.repos.d/fury-nushell.repo
6768 # Install Nushell via dnf
6869 dnf install -y nushell
70+ cat /etc/shells
6971 # Print nushell version to verify installation
7072 nu -c '$nu.current-exe | print; ls $nu.default-config-dir | print; version'
7173
8385 echo "deb https://apt.fury.io/nushell/ /" | sudo tee /etc/apt/sources.list.d/fury.list
8486 sudo apt update
8587 sudo apt install nushell
88+ cat /etc/shells
8689 nu -c '$nu.current-exe | print; ls $nu.default-config-dir | print; version'
8790
8891 install-on-arch :
98101 | grep browser_download_url | cut -d '"' -f 4 | grep x86_64.pkg.tar.zst \
99102 | xargs wget -O nushell.pkg.tar.zst
100103 pacman -U --noconfirm nushell.pkg.tar.zst
104+ cat /etc/shells
101105 nu -c '$nu.current-exe | print; ls $nu.default-config-dir | print; version'
102106
103107 install-on-debian :
@@ -124,4 +128,5 @@ jobs:
124128 echo "deb [trusted=yes] https://apt.fury.io/nushell/ /" | tee /etc/apt/sources.list.d/fury.list
125129 apt update
126130 apt install nushell
131+ cat /etc/shells
127132 nu -c '$nu.current-exe | print; ls $nu.default-config-dir | print; version'
Original file line number Diff line number Diff line change @@ -106,11 +106,14 @@ contents:
106106 dst : /usr/libexec/nushell/nu_plugin_formats
107107 - src : ./scripts/post-install.nu
108108 dst : /usr/libexec/nushell/post-install.nu
109+ - src : ./scripts/pre-remove.nu
110+ dst : /usr/libexec/nushell/pre-remove.nu
109111 - src : ./release/LICENSE
110112 dst : /usr/share/licenses/nushell/LICENSE
111113
112114# Scripts to run at specific stages. (overridable)
113115scripts :
116+ preremove : ./scripts/pre-remove.sh
114117 postinstall : ./scripts/post-install.sh
115118
116119# Custom configuration applied only to the Deb packager.
Original file line number Diff line number Diff line change @@ -30,6 +30,15 @@ def 'setup-plugins' [] {
3030 # plugin list | select name version filename | print
3131}
3232
33+ # Add /usr/bin/nu to /etc/shells if it's not already there
34+ def 'add-shells' [] {
35+ let shells = open /etc/shells
36+ if not ($shells =~ $' /usr/bin/nu' ) {
37+ echo $' /usr/bin/nu(char nl )' o>> /etc/shells
38+ }
39+ }
40+
3341def main [] {
3442 setup-plugins
43+ add-shells
3544}
Original file line number Diff line number Diff line change 1+ #!/usr/bin/env nu
2+ # Author: hustcer
3+ # Created: 2025/03/10 08:25:20
4+ # Description: Script to run before removing Nushell.
5+
6+ # Remove /usr/bin/nu from /etc/shells
7+ def 'remove-shells' [] {
8+ open /etc/shells
9+ | lines
10+ | where $it !~ ' /usr/bin/nu'
11+ | str join " \n "
12+ | save - rf /etc/shells
13+ }
14+
15+ def main [] {
16+ remove-shells
17+ }
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+ # Author: hustcer
3+ # Created: 2025/03/10 08:35:20
4+
5+ nu /usr/libexec/nushell/pre-remove.nu
You can’t perform that action at this time.
0 commit comments