Comparing version 3.2.0 to 3.3.0
@@ -65,18 +65,5 @@ "use strict"; | ||
const tempDir = new (_lazyVal().Lazy)(() => { | ||
let promise; | ||
const systemTmpDir = process.env.TEST_TMP_DIR || process.env.ELECTRON_BUILDER_TMP_DIR || process.env.ELECTRON_BUILDER_TEST_DIR || (0, _os().tmpdir)(); | ||
const systemTmpDir = process.env.APP_BUILDER_TMP_DIR || (0, _os().tmpdir)(); | ||
const isEnsureRemovedOnExit = process.env.TMP_DIR_MANAGER_ENSURE_REMOVED_ON_EXIT !== "false"; | ||
if (!isEnsureRemovedOnExit) { | ||
promise = Promise.resolve(systemTmpDir); | ||
} else if (_fsExtraP().mkdtemp == null) { | ||
const dir = path.join(systemTmpDir, getTempName("temp-files")); | ||
promise = (0, _fsExtraP().ensureDir)(dir, { | ||
mode: 448 | ||
}).then(() => dir); | ||
} else { | ||
promise = (0, _fsExtraP().mkdtemp)(`${path.join(systemTmpDir, "temp-dir")}-`); | ||
} | ||
return promise.then(it => (0, _fsExtraP().realpath)(it)).then(dir => { | ||
return (0, _fsExtraP().mkdtemp)(`${path.join(systemTmpDir, "t-")}-`).then(it => (0, _fsExtraP().realpath)(it)).then(dir => { | ||
if (isEnsureRemovedOnExit) { | ||
@@ -149,3 +136,3 @@ addExitHook(dir); | ||
getTempFile(options, isDir = false) { | ||
return tempDir.value.then(it => { | ||
return tempDir.value.then(baseTempDir => { | ||
if (!this.registered) { | ||
@@ -160,3 +147,3 @@ this.registered = true; | ||
const nameSuffix = suffix == null ? "" : suffix.startsWith(".") ? suffix : `-${suffix}`; | ||
const result = `${it}${path.sep}${namePrefix}${(tmpFileCounter++).toString(36)}${nameSuffix}`; | ||
const result = `${baseTempDir}${path.sep}${namePrefix}${(tmpFileCounter++).toString(36)}${nameSuffix}`; | ||
this.tempFiles.push({ | ||
@@ -163,0 +150,0 @@ path: result, |
{ | ||
"name": "temp-file", | ||
"version": "3.2.0", | ||
"version": "3.3.0", | ||
"main": "out/main.js", | ||
@@ -15,3 +15,3 @@ "author": "Vladimir Krivosheev", | ||
"compile": "ts-babel", | ||
"release": "yarn compile && npm publish" | ||
"release": "BABEL_ENV=production yarn compile && npm publish" | ||
}, | ||
@@ -26,3 +26,3 @@ "dependencies": { | ||
"@types/js-yaml": "^3.11.2", | ||
"@types/node": "^10.12.2", | ||
"@types/node": "^10.12.9", | ||
"babel-preset-ts-node6-bluebird": "^3.0.1", | ||
@@ -29,0 +29,0 @@ "ts-babel": "^6.1.2", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 3 instances in 1 package
4
17358
191