123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- 'use strict';
- const glob = require('glob');
- const argv = require('minimist')(process.argv.slice(2));
- const changeOrAdded = require('./changeOrAdded');
- const check = require('./check');
- const log = require('./log');
- console.warn('⚠️ yarn `build:js` command is deprecated in drupal:9.4.0 and will be removed from drupal:10.0.0. This command is no longer needed in Drupal 10.0.0 once https://www.drupal.org/project/drupal/issues/3278415 is committed.️');
- const fileMatch = './**/*.es6.js';
- const globOptions = {
- ignore: './node_modules/**'
- };
- const processFiles = (error, filePaths) => {
- if (error) {
- process.exitCode = 1;
- }
-
- let callback = changeOrAdded;
- if (argv.check) {
- callback = check;
- }
- filePaths.forEach(callback);
- };
- if (argv.file) {
- processFiles(null, [].concat(argv.file));
- }
- else {
- glob(fileMatch, globOptions, processFiles);
- }
- process.exitCode = 0;
|