MCPcopy Index your code
hub / github.com/loopbackio/loopback-next / updateLicense

Function updateLicense

packages/cli/generators/copyright/license.js:82–100  ·  view source on GitHub ↗
(projectRoot, pkg, options)

Source from the content-addressed store, hash-verified

80}
81
82async function updateLicense(projectRoot, pkg, options) {
83 if (!options.updateLicense) return;
84 const fs = options.fs || FSE;
85 let licenseId = options.license;
86 if (typeof licenseId === 'object') {
87 licenseId = licenseId.id;
88 }
89 pkg.set('license', licenseId);
90 pkg.set('copyright.owner', options.copyrightOwner);
91 await fs.write(
92 path.join(projectRoot, 'LICENSE'),
93 renderLicense({
94 name: pkg.get('name'),
95 owner: options.copyrightOwner,
96 license: options.license,
97 years: await getYears(projectRoot),
98 }),
99 );
100}
101
102exports.renderLicense = renderLicense;
103exports.spdxLicenseList = spdxLicenseList;

Callers 1

updateLicenseMethod · 0.85

Calls 4

renderLicenseFunction · 0.85
getYearsFunction · 0.85
setMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected