refactor: add license header to JS files & format files (#12035)

This commit is contained in:
Victor Berchet
2016-10-04 13:15:49 -07:00
committed by Chuck Jazdzewski
parent b64b5ece65
commit 8310c91823
73 changed files with 1174 additions and 948 deletions

View File

@ -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
*/
/**
* TODO: remove this file when license is included in RxJS bundles.
@ -17,22 +24,19 @@ ${license}
**/
`;
var bundles = fs.readdirSync(args['build-path'])
// Match files that begin with Rx and end with js
.filter(bundle => /^Rx\.?.*\.js$/.test(bundle))
// Load file contents
.map(bundle => {
return {
path: bundle,
contents: fs.readFileSync(`${args['build-path']}/${bundle}`).toString()
};
})
// Concatenate license to bundle
.map(bundle => {
return {
path: bundle.path,
contents: `${license}${bundle.contents}`
};
})
// Write file to disk
.forEach(bundle => fs.writeFileSync(`${args['build-path']}/${bundle.path}`, bundle.contents));
var bundles =
fs.readdirSync(args['build-path'])
// Match files that begin with Rx and end with js
.filter(bundle => /^Rx\.?.*\.js$/.test(bundle))
// Load file contents
.map(bundle => {
return {
path: bundle,
contents: fs.readFileSync(`${args['build-path']}/${bundle}`).toString()
};
})
// Concatenate license to bundle
.map(bundle => { return {path: bundle.path, contents: `${license}${bundle.contents}`}; })
// Write file to disk
.forEach(
bundle => fs.writeFileSync(`${args['build-path']}/${bundle.path}`, bundle.contents));