* We can not use workspaces because we want single package-lock.json files in each samples. * Also the e2e test and update repo https://github.tools.sap/cloudsdk/k8s-e2e-app replaces the local pacakge.json files with one with the same name.
()
| 12 | * Also the e2e test and update repo https://github.tools.sap/cloudsdk/k8s-e2e-app replaces the local pacakge.json files with one with the same name. |
| 13 | */ |
| 14 | async function forAll() { |
| 15 | for (let i = 0; i < samples.length; i++) { |
| 16 | const packageJsonPath = resolve( |
| 17 | __dirname, |
| 18 | '../', |
| 19 | samples[i], |
| 20 | 'package.json' |
| 21 | ); |
| 22 | const jsonContent = JSON.parse( |
| 23 | readFileSync(packageJsonPath, { encoding: 'utf-8' }) |
| 24 | ); |
| 25 | setSdkVersion(jsonContent.dependencies); |
| 26 | setSdkVersion(jsonContent.devDependencies); |
| 27 | await writeFile(packageJsonPath, JSON.stringify(jsonContent, null, 2), { |
| 28 | encoding: 'utf-8' |
| 29 | }); |
| 30 | console.log(`Package.json updated in ${samples[i]}`); |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | function setSdkVersion(dependencies: Record<string, string>) { |
| 35 | Object.keys(dependencies).forEach(key => { |
no test coverage detected