Skip to content

Commit 7d7e1af

Browse files
authored
fix: Ensure config directory exists in post-install and pre-remove (#70)
This was causing install to fail for rpm-ostree install.
1 parent 9a16428 commit 7d7e1af

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

scripts/post-install.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,17 @@
22
# Author: hustcer
33
# Created: 2025/02/25 18:55:20
44

5+
set -e
6+
7+
# Running nu in the rpm-ostree script environment fails if the config directory
8+
# doesn't exist, preventing the post-install.nu script from being run.
9+
if [ -n "${XDG_CONFIG_HOME+x}" ]; then
10+
mkdir -p "$XDG_CONFIG_HOME"
11+
elif [ -n "${HOME+x}" ]; then
12+
mkdir -p "$HOME/.config"
13+
else
14+
export XDG_CONFIG_HOME="$PWD/.config"
15+
mkdir -p "$XDG_CONFIG_HOME"
16+
fi
17+
518
nu /usr/libexec/nushell/post-install.nu

scripts/pre-remove.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,17 @@
22
# Author: hustcer
33
# Created: 2025/03/10 08:35:20
44

5+
set -e
6+
7+
# Running nu in the rpm-ostree script environment fails if the config directory
8+
# doesn't exist, preventing the pre-remove.nu script from being run.
9+
if [ -n "${XDG_CONFIG_HOME+x}" ]; then
10+
mkdir -p "$XDG_CONFIG_HOME"
11+
elif [ -n "${HOME+x}" ]; then
12+
mkdir -p "$HOME/.config"
13+
else
14+
export XDG_CONFIG_HOME="$PWD/.config"
15+
mkdir -p "$XDG_CONFIG_HOME"
16+
fi
17+
518
nu /usr/libexec/nushell/pre-remove.nu

0 commit comments

Comments
 (0)