builder-util
Advanced tools
Comparing version 2.0.1 to 2.0.2
@@ -125,8 +125,2 @@ "use strict"; | ||
var _fcopyPreBundled; | ||
function _load_fcopyPreBundled() { | ||
return _fcopyPreBundled = _interopRequireDefault(require("fcopy-pre-bundled")); | ||
} | ||
var _fsExtraP; | ||
@@ -215,5 +209,22 @@ | ||
} | ||
return new (_bluebirdLst2 || _load_bluebirdLst2()).default((resolve, reject) => { | ||
(0, (_fcopyPreBundled || _load_fcopyPreBundled()).default)(src, dest, stats == null ? undefined : { mode: stats.mode }, error => error == null ? resolve() : reject(error)); | ||
}); | ||
if ((_fsExtraP || _load_fsExtraP()).copyFile == null) { | ||
return new (_bluebirdLst2 || _load_bluebirdLst2()).default((resolve, reject) => { | ||
const reader = (0, (_fsExtraP || _load_fsExtraP()).createReadStream)(src); | ||
const writer = (0, (_fsExtraP || _load_fsExtraP()).createWriteStream)(dest, stats === null ? undefined : { mode: stats.mode }); | ||
reader.on("error", reject); | ||
writer.on("error", reject); | ||
writer.on("open", () => { | ||
reader.pipe(writer); | ||
}); | ||
writer.once("close", resolve); | ||
}); | ||
} else { | ||
// node 8.5.0 | ||
return (0, (_fsExtraP || _load_fsExtraP()).copyFile)(src, dest).then(() => { | ||
if (stats != null) { | ||
return (0, (_fsExtraP || _load_fsExtraP()).chmod)(dest, stats.mode); | ||
} | ||
return null; | ||
}); | ||
} | ||
} | ||
@@ -220,0 +231,0 @@ class FileCopier { |
import { PackageBuilder } from "./api"; | ||
export declare function getLicenseAssets(fileNames: Array<string>, packager: PackageBuilder): { | ||
file: string; | ||
lang: string; | ||
langWithRegion: string; | ||
langName: any; | ||
}[]; | ||
export declare function getLicenseFiles(packager: PackageBuilder): Promise<Array<LicenseFile>>; | ||
@@ -3,0 +9,0 @@ export interface LicenseFile { |
@@ -16,22 +16,6 @@ "use strict"; | ||
var _ref = (0, (_bluebirdLst || _load_bluebirdLst()).coroutine)(function* (packager) { | ||
const files = (yield packager.resourceList).filter(function (it) { | ||
return getLicenseAssets((yield packager.resourceList).filter(function (it) { | ||
const name = it.toLowerCase(); | ||
return (name.startsWith("license_") || name.startsWith("eula_")) && (name.endsWith(".rtf") || name.endsWith(".txt")); | ||
}).sort(function (a, b) { | ||
const aW = a.indexOf("_en") !== -1 ? 0 : 100; | ||
const bW = b.indexOf("_en") !== -1 ? 0 : 100; | ||
return aW === bW ? a.localeCompare(b) : aW - bW; | ||
}); | ||
return files.map(function (file) { | ||
let lang = file.match(/_([^.]+)\./)[1]; | ||
let langWithRegion; | ||
if (lang.indexOf("_") !== -1) { | ||
langWithRegion = lang; | ||
lang = langWithRegion.substring(0, lang.indexOf("_")); | ||
} else { | ||
lang = lang.toLowerCase(); | ||
langWithRegion = (0, (_langs || _load_langs()).toLangWithRegion)(lang); | ||
} | ||
return { file: _path.join(packager.buildResourcesDir, file), lang, langWithRegion, langName: (_langs || _load_langs()).langIdToName[lang] }; | ||
}); | ||
}), packager); | ||
}); | ||
@@ -46,2 +30,4 @@ | ||
exports.getLicenseAssets = getLicenseAssets; | ||
var _path = _interopRequireWildcard(require("path")); | ||
@@ -55,2 +41,21 @@ | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } | ||
function getLicenseAssets(fileNames, packager) { | ||
return fileNames.sort((a, b) => { | ||
const aW = a.indexOf("_en") !== -1 ? 0 : 100; | ||
const bW = b.indexOf("_en") !== -1 ? 0 : 100; | ||
return aW === bW ? a.localeCompare(b) : aW - bW; | ||
}).map(file => { | ||
let lang = file.match(/_([^.]+)\./)[1]; | ||
let langWithRegion; | ||
if (lang.indexOf("_") !== -1) { | ||
langWithRegion = lang; | ||
lang = langWithRegion.substring(0, lang.indexOf("_")); | ||
} else { | ||
lang = lang.toLowerCase(); | ||
langWithRegion = (0, (_langs || _load_langs()).toLangWithRegion)(lang); | ||
} | ||
return { file: _path.join(packager.buildResourcesDir, file), lang, langWithRegion, langName: (_langs || _load_langs()).langIdToName[lang] }; | ||
}); | ||
} |
{ | ||
"name": "builder-util", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"main": "out/util.js", | ||
@@ -15,4 +15,3 @@ "author": "Vladimir Krivosheev", | ||
"temp-file": "^2.0.3", | ||
"fs-extra-p": "^4.4.0", | ||
"fcopy-pre-bundled": "0.3.4", | ||
"fs-extra-p": "^4.4.2", | ||
"is-ci": "^1.0.10", | ||
@@ -24,5 +23,5 @@ "stat-mode": "^0.2.2", | ||
"node-emoji": "^1.8.1", | ||
"builder-util-runtime": "^1.0.0", | ||
"source-map-support": "^0.4.17", | ||
"7zip-bin": "^2.2.3", | ||
"builder-util-runtime": "^1.0.2", | ||
"source-map-support": "^0.4.18", | ||
"7zip-bin": "^2.2.4", | ||
"ini": "^1.3.4", | ||
@@ -32,5 +31,5 @@ "tunnel-agent": "^0.6.0", | ||
"lazy-val": "^1.0.2", | ||
"js-yaml": "^3.9.1" | ||
"js-yaml": "^3.10.0" | ||
}, | ||
"typings": "./out/util.d.ts" | ||
} |
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
182735
16
2350
- Removedfcopy-pre-bundled@0.3.4
- Removedfcopy-pre-bundled@0.3.4(transitive)
Updated7zip-bin@^2.2.4
Updatedbuilder-util-runtime@^1.0.2
Updatedfs-extra-p@^4.4.2
Updatedjs-yaml@^3.10.0
Updatedsource-map-support@^0.4.18