mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-27 20:25:12 +00:00
Avoid using chmod --reference in style.fish
chmod --reference is not available on OS X Instead, we copy the source file into the temporary path, so that mode bits are preserved
This commit is contained in:
parent
5d20750aaa
commit
d910aa15fe
1 changed files with 2 additions and 2 deletions
|
@ -73,13 +73,13 @@ if set -q c_files[1]
|
||||||
echo Running clang-format
|
echo Running clang-format
|
||||||
echo ========================================
|
echo ========================================
|
||||||
for file in $c_files
|
for file in $c_files
|
||||||
|
cp $file $file.new # preserves mode bits
|
||||||
clang-format $file >$file.new
|
clang-format $file >$file.new
|
||||||
if cmp --quiet $file $file.new
|
if cmp --quiet $file $file.new
|
||||||
echo $file was correctly formatted
|
echo $file was correctly formatted
|
||||||
rm $file.new
|
rm $file.new
|
||||||
else
|
else
|
||||||
echo $file was NOT correctly formatted
|
echo $file was NOT correctly formatted
|
||||||
chmod --reference=$file $file.new
|
|
||||||
mv $file.new $file
|
mv $file.new $file
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -101,13 +101,13 @@ if set -q f_files[1]
|
||||||
echo Running fish_indent
|
echo Running fish_indent
|
||||||
echo ========================================
|
echo ========================================
|
||||||
for file in $f_files
|
for file in $f_files
|
||||||
|
cp $file $file.new # preserves mode bits
|
||||||
fish_indent <$file >$file.new
|
fish_indent <$file >$file.new
|
||||||
if cmp --quiet $file $file.new
|
if cmp --quiet $file $file.new
|
||||||
echo $file was correctly formatted
|
echo $file was correctly formatted
|
||||||
rm $file.new
|
rm $file.new
|
||||||
else
|
else
|
||||||
echo $file was NOT correctly formatted
|
echo $file was NOT correctly formatted
|
||||||
chmod --reference=$file $file.new
|
|
||||||
mv $file.new $file
|
mv $file.new $file
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue