ISSUE-295 use "mktemp" instead of creating files locally which makes it possible to install Refine under a different user than the one executing it on *nix systems

git-svn-id: http://google-refine.googlecode.com/svn/trunk@1956 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
Stefano Mazzocchi 2010-12-24 20:05:57 +00:00
parent 209f157656
commit 9c98842132

14
refine
View File

@ -91,11 +91,15 @@ add_option() {
}
load_configs() {
cat $1 | egrep "^[A-Z]" | sed 's/^\(.*\)$/export \1/' > .$1
. ./.$1
rm ./.$1
TEMP_CONFIG=$(mktemp -t refine.XXXXXXX)
if [ "${TEMP_CONFIG}" == "" ]; then
error "Could not create temporary file to load configurations"
fi
cat $1 | egrep "^[A-Z]" | sed 's/^\(.*\)$/export \1/' > ${TEMP_CONFIG}
. ${TEMP_CONFIG}
rm ${TEMP_CONFIG}
}
check_macosx() {
if [ "$OS" != "macosx" ] ; then
error "This action can only run on MacOSX"
@ -937,3 +941,5 @@ case "$ACTION" in
dist) dist $1;;
*) usage; ;;
esac
# ----------- end of file --------------------