Use explicitly relative paths when sourcing now that . is not in path
Add comment about perf issues with menu()
This commit is contained in:
parent
9139cdafc6
commit
bdf9922a24
4 changed files with 25 additions and 22 deletions
18
bin/fproc_cache.rc
Executable file
18
bin/fproc_cache.rc
Executable file
|
|
@ -0,0 +1,18 @@
|
|||
#!/usr/bin/env rc
|
||||
#. 9.rc # Not really needed when calling from werc, only would be needed if you use fproc_cache.rc standalone
|
||||
|
||||
proc=$1
|
||||
|
||||
tmpfile=/tmp/fmttmp.$pid
|
||||
score=`{{tee $tmpfile || exit 1} | sha1sum}
|
||||
|
||||
cachedir=/tmp/fproc_cache/$score
|
||||
mkdir -p $cachedir >[2]/dev/null
|
||||
|
||||
if(test -f $cachedir/$proc)
|
||||
cat $cachedir/$proc
|
||||
if not {
|
||||
$proc < $tmpfile | tee $cachedir/$pid
|
||||
mv $cachedir/$pid $cachedir/$proc
|
||||
}
|
||||
rm $tmpfile >[2]/dev/null
|
||||
Loading…
Add table
Add a link
Reference in a new issue