MCPcopy
hub / github.com/electron/forge / updatePackageScript

Function updatePackageScript

packages/api/core/src/api/import.ts:237–250  ·  view source on GitHub ↗
(
                scriptName: string,
                newValue: string,
              )

Source from the content-addressed store, hash-verified

235 d('reading current scripts object:', packageJSON.scripts);
236
237 const updatePackageScript = async (
238 scriptName: string,
239 newValue: string,
240 ) => {
241 if (packageJSON.scripts[scriptName] !== newValue) {
242 let update = true;
243 if (typeof shouldUpdateScript === 'function') {
244 update = await shouldUpdateScript(scriptName, newValue);
245 }
246 if (update) {
247 packageJSON.scripts[scriptName] = newValue;
248 }
249 }
250 };
251
252 await updatePackageScript('start', 'electron-forge start');
253 await updatePackageScript('package', 'electron-forge package');

Callers 1

import.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected