rogalmic / vscode-bash-debug

Bash shell debugger extension for VSCode (based on bashdb)
MIT License
227 stars 26 forks source link

mktemp: illegal option -- - #19

Closed m-thomson closed 7 years ago

m-thomson commented 7 years ago

On MacOS I'm seeing the following error when trying to start a debug session:

screenshot_3dfb6f
m-thomson commented 7 years ago

It turns out that mktemp on MacOS doesn't support the "--dry-run" option flag. It needs to be changed to "-u" on line 75 https://github.com/rogalmic/vscode-bash-debug/blob/6714b2f7e190030ce1e37d2d3336cd3983206bf5/src/bashDebug.ts

This change worked for me but to be honest I'm not exactly sure the flags are 100% equivilant. The man page for MacOS mktemp says:

-u Operate in 'unsafe' mode. The temp file will be unlinked before mktemp exits. This is slightly better than mktemp(3) but still introduces a race condition. Use of this option is not encouraged.

rogalmic commented 7 years ago

Yes, I think it is safe to change that:

" -u, --dry-run do not create anything; merely print a name (unsafe)"

rogalmic commented 7 years ago

Usage of mktemp was removed, better to handle that internally in typescipt code...