Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In Git Bash no mktemp #103

Closed
albertosantini opened this issue Jun 8, 2013 · 5 comments
Closed

In Git Bash no mktemp #103

albertosantini opened this issue Jun 8, 2013 · 5 comments

Comments

@albertosantini
Copy link

In Git Bash (on Windows) there is not mktemp.

A quick and dirty workaround:

# tempfile="$(mktemp "$datafile.XXXXXX")" || return
tempfile="/tmp/.z.tmp"

Maybe an awk approach or a _Z_DATA and _Z_DATA_OLD one may be feasible.

@albertosantini
Copy link
Author

Alternative approaches:

  • Use of $RANDOM bash shell variable
  • Use of $$ variable

http://www.cyberciti.biz/tips/shell-scripting-bash-how-to-create-temporary-random-file-name.html

@rupa
Copy link
Owner

rupa commented Jun 10, 2013

I don't mind removing this dependency with a purely shell solution.

@rupa rupa closed this as completed in 9e1e288 Jun 10, 2013
@pimgeek
Copy link

pimgeek commented Nov 19, 2013

I had encountered with the same problem and solved it by downloading mktemp binary for windows and uncompressing it under git/bin. Then it works. (I was trying to run leiningen [lein help] command under Git Bash, on Windows 7)

The download site I visited is as follows:
http://gnuwin32.sourceforge.net/packages/mktemp.htm

@rupa
Copy link
Owner

rupa commented Nov 20, 2013

I did remove the mktemp dependency ... are you using an old version?

@abeldantas
Copy link

I'm using version 1.9.5 and it has this problem
git-ftp: line 28: mktemp: command not found

and in git-ftp line 28 I have:
readonly TMP_DIR="$(mktemp -d -t git-ftp-XXXX)"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants