removeAll.ts 719 B

1234567891011121314151617181920
  1. /*---------------------------------------------------------------------------------------------
  2. * Copyright (c) Microsoft Corporation. All rights reserved.
  3. * Licensed under the MIT License. See License.txt in the project root for license information.
  4. *--------------------------------------------------------------------------------------------*/
  5. import glob from 'glob';
  6. import path from 'path';
  7. import fs from 'fs';
  8. import { REPO_ROOT } from '../utils';
  9. const files = glob.sync('**/package-lock.json', {
  10. cwd: REPO_ROOT,
  11. ignore: ['**/node_modules/**', '**/out/**']
  12. });
  13. for (const file of files) {
  14. const filePath = path.join(REPO_ROOT, file);
  15. console.log(`Deleting ${file}...`);
  16. fs.unlinkSync(filePath);
  17. }