mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-16 02:40:08 +00:00
fix(rake-fast): make .rake_tasks
write atomic (#12108)
This commit is contained in:
parent
0bb00eddbb
commit
2a15741656
1 changed files with 8 additions and 5 deletions
|
@ -43,14 +43,17 @@ _tasks_changed () {
|
||||||
}
|
}
|
||||||
|
|
||||||
_rake_generate () {
|
_rake_generate () {
|
||||||
echo "version:$_rake_tasks_version" > .rake_tasks
|
local rake_tasks_content="version:$_rake_tasks_version\n"
|
||||||
|
rake_tasks_content+=$(rake --silent --tasks --all \
|
||||||
rake --silent --tasks --all \
|
|
||||||
| sed "s/^rake //" | sed "s/\:/\\\:/g" \
|
| sed "s/^rake //" | sed "s/\:/\\\:/g" \
|
||||||
| sed "s/\[[^]]*\]//g" \
|
| sed "s/\[[^]]*\]//g" \
|
||||||
| sed "s/ *# /\:/" \
|
| sed "s/ *# /\:/" \
|
||||||
| sed "s/\:$//" \
|
| sed "s/\:$//")
|
||||||
>> .rake_tasks
|
|
||||||
|
local rake_tasks_file="$(mktemp -t .rake_tasks.XXXXXX)"
|
||||||
|
echo $rake_tasks_content > $rake_tasks_file
|
||||||
|
|
||||||
|
mv $rake_tasks_file .rake_tasks
|
||||||
}
|
}
|
||||||
|
|
||||||
_rake () {
|
_rake () {
|
||||||
|
|
Loading…
Reference in a new issue