refactor: add license header to JS files & format files (#12035)
This commit is contained in:

committed by
Chuck Jazdzewski

parent
b64b5ece65
commit
8310c91823
@ -1,4 +1,11 @@
|
||||
#!/usr/bin/env node
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
/**
|
||||
* this script is just a temporary solution to deal with the issue of npm outputting the npm
|
||||
@ -14,25 +21,22 @@ var path = require('path');
|
||||
|
||||
|
||||
function cleanModule(moduleRecord, name) {
|
||||
|
||||
// keep `resolve` properties for git dependencies, delete otherwise
|
||||
delete moduleRecord.from;
|
||||
if (!(moduleRecord.resolved && moduleRecord.resolved.match(/^git(\+[a-z]+)?:\/\//))) {
|
||||
delete moduleRecord.resolved;
|
||||
}
|
||||
|
||||
_.forEach(moduleRecord.dependencies, function(mod, name) {
|
||||
cleanModule(mod, name);
|
||||
});
|
||||
_.forEach(moduleRecord.dependencies, function(mod, name) { cleanModule(mod, name); });
|
||||
}
|
||||
|
||||
|
||||
//console.log('Reading npm-shrinkwrap.json');
|
||||
// console.log('Reading npm-shrinkwrap.json');
|
||||
var shrinkwrap = require('../../npm-shrinkwrap.json');
|
||||
|
||||
//console.log('Cleaning shrinkwrap object');
|
||||
// console.log('Cleaning shrinkwrap object');
|
||||
cleanModule(shrinkwrap, shrinkwrap.name);
|
||||
|
||||
var cleanShrinkwrapPath = path.join(__dirname, '..', '..', 'npm-shrinkwrap.clean.json');
|
||||
console.log('writing npm-shrinkwrap.clean.json');
|
||||
fs.writeFileSync(cleanShrinkwrapPath, JSON.stringify(sorted(shrinkwrap), null, 2) + "\n");
|
||||
fs.writeFileSync(cleanShrinkwrapPath, JSON.stringify(sorted(shrinkwrap), null, 2) + '\n');
|
||||
|
Reference in New Issue
Block a user