mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-21 15:23:14 +01:00
fix(rake-fast): make .rake_tasks
write atomic (#12108)
This commit is contained in:
parent
0bb00eddbb
commit
2a15741656
@ -43,14 +43,17 @@ _tasks_changed () {
|
||||
}
|
||||
|
||||
_rake_generate () {
|
||||
echo "version:$_rake_tasks_version" > .rake_tasks
|
||||
|
||||
rake --silent --tasks --all \
|
||||
local rake_tasks_content="version:$_rake_tasks_version\n"
|
||||
rake_tasks_content+=$(rake --silent --tasks --all \
|
||||
| sed "s/^rake //" | sed "s/\:/\\\:/g" \
|
||||
| sed "s/\[[^]]*\]//g" \
|
||||
| sed "s/ *# /\:/" \
|
||||
| sed "s/\:$//" \
|
||||
>> .rake_tasks
|
||||
| sed "s/\:$//")
|
||||
|
||||
local rake_tasks_file="$(mktemp -t .rake_tasks.XXXXXX)"
|
||||
echo $rake_tasks_content > $rake_tasks_file
|
||||
|
||||
mv $rake_tasks_file .rake_tasks
|
||||
}
|
||||
|
||||
_rake () {
|
||||
|
Loading…
Reference in New Issue
Block a user