builder-util
Advanced tools
Comparing version 5.2.0 to 5.3.0
@@ -10,14 +10,2 @@ "use strict"; | ||
var _zipBin; | ||
function _load_zipBin() { | ||
return _zipBin = require("7zip-bin"); | ||
} | ||
var _appBuilderBin; | ||
function _load_appBuilderBin() { | ||
return _appBuilderBin = require("app-builder-bin"); | ||
} | ||
var _util; | ||
@@ -35,3 +23,3 @@ | ||
} | ||
return (0, (_util || _load_util()).spawn)((_appBuilderBin || _load_appBuilderBin()).appBuilderPath, args); | ||
return (0, (_util || _load_util()).executeAppBuilder)(args); | ||
} | ||
@@ -57,7 +45,4 @@ function getBinFromGithub(name, version, checksum) { | ||
} | ||
return (0, (_util || _load_util()).spawn)((_appBuilderBin || _load_appBuilderBin()).appBuilderPath, args, { | ||
env: Object.assign({}, process.env, { SZA_PATH: (_zipBin || _load_zipBin()).path7za }), | ||
stdio: ["ignore", "pipe", process.stdout] | ||
}); | ||
return (0, (_util || _load_util()).executeAppBuilder)(args); | ||
} | ||
//# sourceMappingURL=binDownload.js.map |
@@ -27,3 +27,3 @@ /// <reference types="node" /> | ||
*/ | ||
export declare function copyOrLinkFile(src: string, dest: string, stats?: Stats | null, isUseHardLink?: boolean, exDevErrorHandler?: (() => boolean) | null): Promise<any>; | ||
export declare function copyOrLinkFile(src: string, dest: string, stats?: Stats | null, isUseHardLink?: any, exDevErrorHandler?: (() => boolean) | null): Promise<any>; | ||
export declare class FileCopier { | ||
@@ -30,0 +30,0 @@ private readonly isUseHardLinkFunction; |
@@ -131,8 +131,2 @@ "use strict"; | ||
var _isCi; | ||
function _load_isCi() { | ||
return _isCi = _interopRequireDefault(require("is-ci")); | ||
} | ||
var _path = _interopRequireWildcard(require("path")); | ||
@@ -168,3 +162,3 @@ | ||
const _isUseHardLink = process.platform !== "win32" && process.env.USE_HARD_LINKS !== "false" && ((_isCi || _load_isCi()).default || process.env.USE_HARD_LINKS === "true"); | ||
const _isUseHardLink = process.platform !== "win32" && process.env.USE_HARD_LINKS !== "false" && (require("is-ci") || process.env.USE_HARD_LINKS === "true"); | ||
function copyFile(src, dest, isEnsureDir = true) { | ||
@@ -171,0 +165,0 @@ return (isEnsureDir ? (0, (_fsExtraP || _load_fsExtraP()).ensureDir)(_path.dirname(dest)) : Promise.resolve()).then(() => copyOrLinkFile(src, dest, null, false)); |
/// <reference types="debug" /> | ||
/// <reference types="node" /> | ||
import BluebirdPromise from "bluebird-lst"; | ||
import { ChildProcess, ExecFileOptions, SpawnOptions } from "child_process"; | ||
@@ -28,3 +27,3 @@ import _debug from "debug"; | ||
export declare function doSpawn(command: string, args: Array<string>, options?: SpawnOptions, extraOptions?: ExtraSpawnOptions): ChildProcess; | ||
export declare function spawnAndWrite(command: string, args: Array<string>, data: string, options?: SpawnOptions, isDebugEnabled?: boolean): BluebirdPromise<any>; | ||
export declare function spawnAndWrite(command: string, args: Array<string>, data: string, options?: SpawnOptions, isDebugEnabled?: boolean): Promise<any>; | ||
export declare function spawn(command: string, args?: Array<string> | null, options?: SpawnOptions, extraOptions?: ExtraSpawnOptions): Promise<any>; | ||
@@ -44,1 +43,2 @@ export declare function use<T, R>(value: T | null, task: (it: T) => R): R | null; | ||
} | ||
export declare function executeAppBuilder(args: Array<string>): Promise<string>; |
@@ -208,9 +208,16 @@ "use strict"; | ||
exports.isEnvTrue = isEnvTrue; | ||
exports.executeAppBuilder = executeAppBuilder; | ||
var _bluebirdLst; | ||
var _zipBin; | ||
function _load_bluebirdLst() { | ||
return _bluebirdLst = _interopRequireDefault(require("bluebird-lst")); | ||
function _load_zipBin() { | ||
return _zipBin = require("7zip-bin"); | ||
} | ||
var _appBuilderBin; | ||
function _load_appBuilderBin() { | ||
return _appBuilderBin = require("app-builder-bin"); | ||
} | ||
var _chalk; | ||
@@ -298,3 +305,3 @@ | ||
} | ||
return new (_bluebirdLst || _load_bluebirdLst()).default((resolve, reject) => { | ||
return new Promise((resolve, reject) => { | ||
(0, (_child_process || _load_child_process()).execFile)(file, args, Object.assign({}, options, { maxBuffer: 10 * 1024 * 1024, env: getProcessEnv(options == null ? null : options.env) }), (error, stdout, stderr) => { | ||
@@ -337,2 +344,16 @@ if (error == null) { | ||
} | ||
function logSpawn(command, args, options) { | ||
// use general debug.enabled to log spawn, because it doesn't produce a lot of output (the only line), but important in any case | ||
if (!(_log || _load_log()).log.isDebugEnabled) { | ||
return; | ||
} | ||
const argsString = args.join(" "); | ||
const logFields = { | ||
command: command + " " + (command === "docker" ? argsString : removePassword(argsString)) | ||
}; | ||
if (options != null && options.cwd != null) { | ||
logFields.cwd = options.cwd; | ||
} | ||
(_log || _load_log()).log.debug(logFields, "spawning"); | ||
} | ||
function doSpawn(command, args, options, extraOptions) { | ||
@@ -348,14 +369,3 @@ if (options == null) { | ||
} | ||
// use general debug.enabled to log spawn, because it doesn't produce a lot of output (the only line), but important in any case | ||
if ((_log || _load_log()).log.isDebugEnabled) { | ||
const argsString = args.join(" "); | ||
const logFields = { | ||
command, | ||
args: command === "docker" ? argsString : removePassword(argsString) | ||
}; | ||
if (options != null && options.cwd != null) { | ||
logFields.cwd = options.cwd; | ||
} | ||
(_log || _load_log()).log.debug(logFields, "spawning"); | ||
} | ||
logSpawn(command, args, options); | ||
try { | ||
@@ -370,3 +380,3 @@ return (0, (_child_process || _load_child_process()).spawn)(command, args, options); | ||
const timeout = setTimeout(() => childProcess.kill(), 4 * 60 * 1000); | ||
return new (_bluebirdLst || _load_bluebirdLst()).default((resolve, reject) => { | ||
return new Promise((resolve, reject) => { | ||
handleProcess("close", childProcess, command, false, () => { | ||
@@ -389,3 +399,3 @@ try { | ||
function spawn(command, args, options, extraOptions) { | ||
return new (_bluebirdLst || _load_bluebirdLst()).default((resolve, reject) => { | ||
return new Promise((resolve, reject) => { | ||
const isCollectOutput = options != null && (options.stdio === "pipe" || Array.isArray(options.stdio) && options.stdio.length === 3 && options.stdio[1] === "pipe"); | ||
@@ -514,2 +524,12 @@ handleProcess("close", doSpawn(command, args || [], options, extraOptions), command, isCollectOutput, resolve, reject); | ||
} | ||
exports.InvalidConfigurationError = InvalidConfigurationError; //# sourceMappingURL=util.js.map | ||
exports.InvalidConfigurationError = InvalidConfigurationError; | ||
function executeAppBuilder(args) { | ||
return new Promise((resolve, reject) => { | ||
const command = (_appBuilderBin || _load_appBuilderBin()).appBuilderPath; | ||
handleProcess("close", doSpawn(command, args, { | ||
env: Object.assign({}, process.env, { SZA_PATH: (_zipBin || _load_zipBin()).path7za }), | ||
stdio: ["ignore", "pipe", "inherit"] | ||
}), command, true, resolve, reject); | ||
}); | ||
} | ||
//# sourceMappingURL=util.js.map |
{ | ||
"name": "builder-util", | ||
"version": "5.2.0", | ||
"version": "5.3.0", | ||
"main": "out/util.js", | ||
@@ -14,3 +14,3 @@ "author": "Vladimir Krivosheev", | ||
"dependencies": { | ||
"app-builder-bin": "1.3.1", | ||
"app-builder-bin": "1.3.5", | ||
"temp-file": "^3.1.1", | ||
@@ -17,0 +17,0 @@ "fs-extra-p": "^4.5.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
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
189263
2379
+ Addedapp-builder-bin@1.3.5(transitive)
+ Addedapp-builder-bin-linux@1.3.5(transitive)
+ Addedapp-builder-bin-mac@1.3.5(transitive)
+ Addedapp-builder-bin-win@1.3.5(transitive)
- Removedapp-builder-bin@1.3.1(transitive)
- Removedapp-builder-bin-linux@1.3.1(transitive)
- Removedapp-builder-bin-mac@1.3.1(transitive)
- Removedapp-builder-bin-win@1.3.1(transitive)
Updatedapp-builder-bin@1.3.5