Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit 21a166a

Browse files
committed
Adjust getTempDir callers
1 parent 9fba783 commit 21a166a

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

lib/git-prompt-server.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import net from 'net';
22
import path from 'path';
3+
import os from 'os';
34

45
import {Emitter} from 'event-kit';
56

@@ -25,7 +26,11 @@ export default class GitPromptServer {
2526
// TODO: [mkt] Windows?? yes.
2627
this.promptForInput = promptForInput;
2728
const windows = process.platform === 'win32';
28-
this.tmpFolderPath = await getTempDir('github-');
29+
this.tmpFolderPath = await getTempDir({
30+
dir: windows ? os.tmpdir() : '/tmp',
31+
prefix: 'github-',
32+
symlinkOk: true,
33+
});
2934

3035
const credentialHelper = {};
3136
const askPass = {};

lib/models/discard-history.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ export default class DiscardHistory {
118118
}
119119

120120
async expandBlobsToFilesInTempFolder(snapshots) {
121-
const tempFolderPath = await getTempDir('github-discard-history-');
121+
const tempFolderPath = await getTempDir({prefix: 'github-discard-history-'});
122122
const pathPromises = snapshots.map(async ({filePath, beforeSha, afterSha}) => {
123123
const dir = path.dirname(path.join(tempFolderPath, filePath));
124124
await mkdirp(dir);

test/github-package.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ describe('GithubPackage', function() {
6161

6262
async function constructWith(projectPaths, initialPaths) {
6363
const realProjectPaths = await Promise.all(
64-
projectPaths.map(projectPath => getTempDir(projectPath)),
64+
projectPaths.map(projectPath => getTempDir({prefix: projectPath})),
6565
);
6666

6767
project.setPaths(realProjectPaths);

0 commit comments

Comments
 (0)