Repository URL to install this package:
|
Version:
3.1.2 ▾
|
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const resolveToRoot_1 = require("../resolveToRoot");
const flipfile_1 = require("flipfile");
const di_1 = require("@skava/di");
const pkg = di_1.config.get('package');
function create(requirePath) {
const resolvedPath = resolveToRoot_1.resolveToRoot(requirePath);
flipfile_1.write(resolvedPath, JSON.stringify(pkg, undefined, 2));
}
function tryRequireOrCreate(requirePath) {
const resolvedPath = resolveToRoot_1.resolveToRoot(requirePath);
try {
return require.resolve(resolvedPath);
}
catch (requireException) {
create(requirePath);
return require.resolve(resolvedPath);
}
}
const distPkgPath = tryRequireOrCreate(process.env.OUTPUT_PACKAGE_JSON_PATH);
const distPkg = require(distPkgPath);
console.log({ distPkgPath, distPkg });
// distPkg.env.FEATURE = Boolean(process.env.FEATURE)
// distPkg.env.QA = Boolean(process.env.QA)
// distPkg.env.PREPROD = Boolean(process.env.PREPROD)
distPkg.dependencies = pkg.dependencies;
flipfile_1.write(distPkgPath, JSON.stringify(distPkg, undefined, 2));
//# sourceMappingURL=distPackageDeps.js.map