suntobright / vscode-sftp

Edit remote Linux files directly in VS Code.
MIT License
14 stars 6 forks source link

[bug] Does not respect server $TEMPDIR variable #32

Open Merith-TK opened 2 years ago

Merith-TK commented 2 years ago

$TEMPDIR is quite common on telling programs where the temp dir is, and not all systems will have their tempdir at /tmp,

I am able to use this extension purely because my phone is rooted so I was able to symlink /tmp to /data/data/com.termux/files/usr/tmp, however I should not need to do this, as termux already has an temp dir that everything else respects

~ $ env | grep tmp
TMPDIR=/data/data/com.termux/files/usr/tmp
Merith-TK commented 2 years ago

Potential Fix?? I dont do TS/JS so IDK

export var remoteTempFolderPath: string
if (`${process.env.TMPDIR}`) {
    remoteTempFolderPath = path.posix.join(`${process.env.TMPDIR}`, 'vscode-sftp', md5);
} else {
    remoteTempFolderPath = path.posix.join('/tmp', 'vscode-sftp', md5);
}
export const remoteTempFolder: string = remoteTempFolderPath