source: project/chicken/trunk/scripts/scheme @ 15259

Last change on this file since 15259 was 15259, checked in by felix winkelmann, 10 years ago

renamed cachedir for `scheme' script

  • Property svn:executable set to *
File size: 642 bytes
Line 
1#!/bin/bash
2### usage: scheme FILENAME
3#
4# variables:
5#
6# AUTOCOMPILE_DEBUG
7
8
9dbgoption=
10cache=$HOME/.schemecache
11uname=`uname`
12wd=`pwd`
13
14if test -n "$AUTOCOMPILE_DEBUG"; then
15    set -x
16    dbgoption="-v2"
17fi
18
19if test "$#" == 0; then
20    exec csi
21else
22    prg="$1"
23fi
24
25if test $uname = "Darwin"; then
26    prgh=`md5 -q $prg`
27else
28    prgh=`md5sum $prg | sed -n -e 's/\([^[:space:]]*\).*/\1/p'`
29fi
30
31if test \! -d $cache; then
32    mkdir -p $cache
33fi
34
35if test "$prg" -nt "$cache/$prgh"; then
36    csc $dbgoption "$prg" -o "$cache/$prgh"
37fi
38
39if test -x "$cache/$prgh"; then
40    shift
41    exec "$cache/$prgh" "$@"
42else
43    echo "can not run $1"
44fi
Note: See TracBrowser for help on using the repository browser.