How to use the temp.track function in temp

To help you get started, we’ve selected a few temp examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github joefitzgerald / go-config / spec / locator-spec.js View on Github external
beforeEach(() => {
    temp.track()
    env = Object.assign({}, process.env)
    if (isTruthy(env.GOROOT)) {
      delete env.GOROOT
    }
    environmentFn = () => {
      return env
    }
    readyFn = () => { return true }
    platform = process.platform
    if (process.arch === 'arm') {
      arch = 'arm'
    } else if (process.arch === 'ia32') {
      // Ugh, Atom is 32-bit on Windows... for now.
      if (platform === 'win32') {
        arch = 'amd64'
      } else {
github trufflesuite / truffle / packages / core / lib / commands / migrate.js View on Github external
run: function(options, done) {
    const Artifactor = require("@truffle/artifactor");
    const Resolver = require("@truffle/resolver");
    const Migrate = require("@truffle/migrate");
    const Contracts = require("@truffle/workflow-compile");
    const Provider = require("@truffle/provider");
    const { Environment } = require("@truffle/environment");
    const Config = require("@truffle/config");
    const temp = require("temp").track();
    const { promisify } = require("util");
    const promisifiedCopy = promisify(require("../copy"));

    const conf = Config.detect(options);

    Contracts.compile(conf)
      .then(async () => {
        await Provider.testConnection(conf);
        await Environment.detect(conf);

        const {
          dryRunOnly,
          dryRunAndMigrations
        } = command.determineDryRunSettings(conf, options);

        if (dryRunOnly) {
github JetBrains / teamcity-vscode-extension / src / remoterun / custompatchsender.ts View on Github external
import { FileController } from "../utils/filecontroller";
import { ByteWriter } from "../utils/bytewriter";
import { VsCodeUtils } from "../utils/vscodeutils";
import { Logger } from "../utils/logger";
import { Constants, ChangeListStatus, CvsFileStatusCode } from "../utils/constants";
import { Credential } from "../credentialstore/credential";
import { BuildConfigItem } from "../remoterun/configexplorer";
import { CvsSupportProvider } from "../remoterun/cvsprovider";
import { CheckinInfo, MappingFileContent, RestHeader, QueuedBuild } from "../utils/interfaces";
import { CvsLocalResource } from "../entities/cvsresource";
import { AsyncWriteStream } from "../utils/writestream";
import * as path from "path";
import * as fs from "fs";
import * as xml2js from "xml2js";
import * as request from "request";
const temp = require("temp").track();

export class CustomPatchSender extends XmlRpcProvider implements PatchSender {
    private readonly CHECK_FREQUENCY_MS : number = 10000;
    /**
     * @returns true in case of success, otherwise false.
     */
    public async remoteRun(creds: Credential, configs: BuildConfigItem[], cvsProvider: CvsSupportProvider): Promise {
        //We might not have userId at the moment
        if (!creds.userId) {
            await this.authenticateIfRequired(creds);
        }
        const patchAbsPath : string = await this.preparePatch(cvsProvider);

        const checkInInfo : CheckinInfo = await cvsProvider.getRequiredCheckinInfo();
        const patchDestinationUrl : string = `${creds.serverURL}/uploadChanges.html?userId=${creds.userId}&description="${checkInInfo.message}"&commitType=0`;
        try {
github FreeAllMedia / akiro / es6 / spec / builders / nodejs / akiroBuilder / akiroBuilder.createPackageZip.spec.js View on Github external
import AkiroBuilder from "../../../../lib/akiro/builders/nodejs/akiroBuilder.js";
import sinon from "sinon";
import temp from "temp";
import packageJson from "../../../../../package.json";
import fileSystem from "fs-extra";
import createMockExec from "../../../helpers/mockExec.js";
import createMockTemp from "../../../helpers/mockTemp.js";
import glob from "glob";
import unzip from "unzip2";
import path from "path";

temp.track();

describe("AkiroBuilder(event, context)", () => {
	let event,
			context,
			akiroBuilder,

			nodeModulesDirectoryPath,
			temporaryDirectoryPath,

			mockExec,
			mockNpmPath,
			mockTemp,
			mockAWS,
			mockS3;

	beforeEach((done) => {
github NativeScript / nativescript-cli / lib / common / mobile / android / android-device-file-system.ts View on Github external
private getTempDir(): string {
		temp.track();
		return temp.mkdirSync("application-");
	}
}
github atom / github / spec / git / push-pull-view-model-spec.js View on Github external
/** @babel */

import {GitRepositoryAsync} from 'atom'
import fs from 'fs'
import path from 'path'
import temp from 'temp'

import PushPullViewModel from '../../lib/git/push-pull/push-pull-view-model'
import GitService from '../../lib/git/git-service'
import GitStore from '../../lib/git/git-store'

import {copyRepository, stagePath} from './git-helpers'

temp.track()

async function cloneRepository () {
  const baseRepo = copyRepository()
  const cloneOptions = new GitRepositoryAsync.Git.CloneOptions()
  cloneOptions.bare = 1
  cloneOptions.local = 1

  const parentRepoPath = temp.mkdirSync('git-parent-fixture-')
  await GitRepositoryAsync.Git.Clone.clone(baseRepo, parentRepoPath, cloneOptions)

  const clonedPath = temp.mkdirSync('git-cloned-fixture-')
  cloneOptions.bare = 0
  await GitRepositoryAsync.Git.Clone.clone(parentRepoPath, clonedPath, cloneOptions)
  return {parentRepositoryPath: parentRepoPath, clonedRepositoryPath: clonedPath}
}
github FreeAllMedia / akiro / es6 / spec / akiro / akiro.build.nodejs.spec.js View on Github external
beforeEach(done => {
		temp.track();

		config = {};

		akiro = new Akiro(config);

		temp.mkdir("akiro_build", (error, tempDirectoryPath) => {
			filePath = `${tempDirectoryPath}/akiro.packager.zip`;
			akiro.build(filePath, done);
		});
	});
github FreeAllMedia / akiro / es6 / spec / akiro / akiro.initialize.spec.js View on Github external
import Akiro from "../../lib/akiro.js";
import ConanAwsLambdaPlugin from "conan-aws-lambda";
import MockConan from "../helpers/mockConan.js";
import path from "path";
import temp from "temp";
import sinon from "sinon";
import fileSystem from "fs-extra";
import createMockExec from "../helpers/mockExec.js";
import glob from "glob";
import Async from "flowsync";

temp.track();

describe("akiro.initialize(iamRoleName, callback)", () => {
	let config,
			akiro,
			callback,

			lambdaName,
			lambdaRole,
			lambdaFilePath,
			handlerFilePath,
			temporaryDirectoryPath,

			mockConan,
			mockConanLambda,
			mockTemp,
			mockExec;
github openlayers / openlayers / tasks / build.js View on Github external
/**
 * This task builds OpenLayers with the Closure Compiler.
 */
var path = require('path');

var async = require('async');
var closure = require('closure-util');
var fs = require('fs-extra');
var nomnom = require('nomnom');
var temp = require('temp').track();
var exec = require('child_process').exec;

var generateExports = require('./generate-exports');

var log = closure.log;
var root = path.join(__dirname, '..');

var umdWrapper = ';(function (root, factory) {\n' +
    '  if (typeof exports === "object") {\n' +
    '    module.exports = factory();\n' +
    '  } else if (typeof define === "function" && define.amd) {\n' +
    '    define([], factory);\n' +
    '  } else {\n' +
    '    root.ol = factory();\n' +
    '  }\n' +
    '}(this, function () {\n' +
github FreeAllMedia / akiro / es6 / spec / akiro / akiro.package / akiro.package.invokeError.spec.js View on Github external
import Akiro from "../../../lib/akiro.js";
import temp from "temp";
import sinon from "sinon";
import Async from "flowsync";
import fileSystem from "fs-extra";
import path from "path";

temp.track();

describe("akiro.package(packageDetails, outputDirectoryPath, callback)", () => {
	let config,
			akiro,
			error,

			packageDetails,

			cacheDirectoryPath,
			outputDirectoryPath,

			asyncZipFileName,
			asyncZipFilePath,

			mockAsync,
			mockAWS,