mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-15 21:42:46 +08:00
![Joan Bruguera Micó](/assets/img/avatar_default.png)
Some checks are pending
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
If base directories (e.g. $HOME/.config/fish) need to be created, create them with mode 0700 (i.e. restricted to the owner). This both keeps the behavior of old fish versions (e.g. 3.7.1) and is compliant with the XDG Base Directory Specification. See: https://specifications.freedesktop.org/basedir-spec/0.8/#referencing
17 lines
554 B
Fish
17 lines
554 B
Fish
#RUN: %fish -C 'set -l fish %fish' %s
|
|
|
|
# Set a XDG_CONFIG_HOME with both pre-existing and non-existing directories.
|
|
set -l dir (mktemp -d)
|
|
mkdir -m 0755 $dir/old
|
|
set -gx XDG_CONFIG_HOME $dir/old/new
|
|
|
|
# Launch fish so it will create all missing directories.
|
|
$fish -c ''
|
|
|
|
# Check that existing directories kept their permissions, and new directories
|
|
# have the right permissions according to the XDG Base Directory Specification.
|
|
ls -ld $dir/old $dir/old/new $dir/old/new/fish | awk '{print $1}'
|
|
# CHECK: drwxr-xr-x
|
|
# CHECK: drwx------
|
|
# CHECK: drwx------
|