fork/fish-shell

git clone https://git.julia.blue/fork/fish-shell

Johannes Altmanninger__fish_cache_put: fix for BusyBox statf03113d04

master
476 B15 linesraw
1# localization: skip(private)
2function __fish_cache_put
3    set -l cache_file $argv[1]
4    touch $cache_file
5    set -l dir (path dirname $cache_file)
6    chown --reference=$dir $cache_file 2>/dev/null ||
7        chown (
8            if stat --version 2>&1 | string match -q 'BusyBox*'
9                stat -c '%u:%g' $dir
10            else
11                stat --format '%u:%g' $dir 2>/dev/null ||
12                stat -f '%u:%g' $dir
13            end
14        ) $cache_file
15end