fabacab / git-archive-all.sh

A bash shell script wrapper for git-archive that archives a git superproject and its submodules, if it has any.
214 stars 86 forks source link

Remove mktemp dependancy #9

Closed ByFe closed 7 years ago

ByFe commented 11 years ago

Removes mktemp dependancy by exchanging with $RANDOM because mktemp is not available when using msysgit.

ByFe commented 11 years ago

The main reason why I proposed this change is of course compatibility. As already stated mktemp isn't availabe when using msysgit by default so the script is broken because of this dependency. Anyway I can understand your point of view so you would prefer some fallback implementation like this?:

command -v mktemp >/dev/null && { 
    TMPFILE=`mktemp "$TMPDIR/$PROGRAM.XXXXXX"`; 
    TOARCHIVE=`mktemp "$TMPDIR/$PROGRAM.toarchive.XXXXXX"`; 
} || { 
    TMPFILE="$TMPDIR/$PROGRAM.$RANDOM"; 
    TOARCHIVE="$TMPDIR/$PROGRAM.toarchive.$RANDOM"; 
}

Maybe there is also another compatible alternative to $RANDOM closer to mktemp functionality out there?! $RANDOM was just the first and thus fastest workaround for the missing mktemp problem which kept me from using this script in my enviroment.

t-b commented 7 years ago

mktemp is part of newer git for windows versions.

fabacab commented 7 years ago

If mktemp is part of newer Windows installs then I will close this without merge because this was never really intended to be a script for Windows systems in the first place and I'd rather leave it up to Windows to move towards POSIX compatibility than do work myself to support an Operating System that is both capitalistically evil and that I never actually cared to support in the first place. :)

Thank you for the note, @t-b!