| 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'); |