Skip to content
This repository has been archived by the owner on Aug 25, 2021. It is now read-only.

Commit

Permalink
Merge pull request #268 from midwayjs/chore/custom_tmp_dir
Browse files Browse the repository at this point in the history
chore: custom tmp dir
  • Loading branch information
czy88840616 authored Oct 25, 2018
2 parents 290e988 + 5df9395 commit b9c4a44
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/messenger/src/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import assert = require('assert');
import eventName from './eventName';
import * as os from 'os';
import * as path from 'path';
const tmpDir = os.tmpdir();
const tmpDir = process.env.PANDORA_TMP_DIR || os.tmpdir();
const sockPath = Symbol('sockpath');

class MessengerBase extends Base {
Expand Down
5 changes: 3 additions & 2 deletions packages/pandora/src/application/ProcfileReconciler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ import {ProcfileReconcilerAccessor} from './ProcfileReconcilerAccessor';
import {exec} from 'child_process';
import uuid = require('uuid');
import mzFs = require('mz/fs');
import {tmpdir} from 'os';
import * as os from 'os';

const tmpdir = process.env.PANDORA_TMP_DIR || os.tmpdir();
const foundAll = Symbol();

/**
Expand Down Expand Up @@ -402,7 +403,7 @@ export class ProcfileReconciler {
*/
public static async getStructureViaNewProcess(appRepresentation: ApplicationRepresentation): Promise<ApplicationStructureRepresentation> {

const tmpFile = join(tmpdir(), uuid.v4());
const tmpFile = join(tmpdir, uuid.v4());
const isTs = /\.ts$/.test(__filename);

await new Promise((resolve, reject) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/pandora/src/daemon/DaemonHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import mkdirp = require('mkdirp');
const {consoleLogger} = require('../../cli/util/cliUtils');

const is = require('is-type-of');
const tmpDir = os.tmpdir();
const tmpDir = process.env.PANDORA_TMP_DIR || os.tmpdir();
const pidFile = path.join(tmpDir, 'nodejs_pandora.pid');
const pathDaemonBootstrap = require.resolve('./DaemonBootstrap');
let preparedClient: MessengerClient = null;
Expand Down

0 comments on commit b9c4a44

Please sign in to comment.