build(publish): remove unneeded add-license-to-rx (#12734)
This commit is contained in:
parent
2aba8b0ff2
commit
458ca7112a
|
@ -1,42 +0,0 @@
|
||||||
#! /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.
|
|
||||||
* https://github.com/ReactiveX/RxJS/issues/1067
|
|
||||||
*
|
|
||||||
* This script runs after bundles have already been copied to the build-path,
|
|
||||||
* to prepend the license to each bundle.
|
|
||||||
**/
|
|
||||||
var fs = require('fs');
|
|
||||||
var args = require('minimist')(process.argv);
|
|
||||||
|
|
||||||
var license = fs.readFileSync(args['license-path']);
|
|
||||||
// Make the license block into a JS comment
|
|
||||||
license = `/**
|
|
||||||
${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));
|
|
|
@ -23,7 +23,6 @@ function init {
|
||||||
IS_SNAPSHOT_BUILD=
|
IS_SNAPSHOT_BUILD=
|
||||||
fi
|
fi
|
||||||
RX_BUNDLE_DIR=$(resolveDir ../../node_modules/rxjs/bundles)
|
RX_BUNDLE_DIR=$(resolveDir ../../node_modules/rxjs/bundles)
|
||||||
RX_LICENSE=$(resolveDir ../../node_modules/rxjs)/LICENSE.txt
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function prepare {
|
function prepare {
|
||||||
|
@ -57,7 +56,6 @@ function prepare {
|
||||||
mkdir $REPO_DIR/$NEW_VERSION
|
mkdir $REPO_DIR/$NEW_VERSION
|
||||||
cp -r $BUILD_DIR/* $REPO_DIR/$NEW_VERSION/
|
cp -r $BUILD_DIR/* $REPO_DIR/$NEW_VERSION/
|
||||||
cp -r $RX_BUNDLE_DIR/* $REPO_DIR/$NEW_VERSION/
|
cp -r $RX_BUNDLE_DIR/* $REPO_DIR/$NEW_VERSION/
|
||||||
node ./add-license-to-rx.js --license-path=$RX_LICENSE --build-path=$REPO_DIR/$NEW_VERSION
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
Loading…
Reference in New Issue