@atomist/atomist-sdm
Version:
Atomist SDM to deliver our own projects
37 lines • 1.67 kB
JavaScript
;
/*
* Copyright © 2019 Atomist, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
const sdm_1 = require("@atomist/sdm");
const sdm_pack_node_1 = require("@atomist/sdm-pack-node");
const addHeader_1 = require("./addHeader");
exports.LicenseFilename = "LICENSE";
exports.AddAtomistTypeScriptHeader = addAtomistHeader("TypeScript header", "**/*.ts", sdm_pack_node_1.IsTypeScript);
function addAtomistHeader(name, glob, pushTest) {
const parametersInstance = new addHeader_1.AddHeaderParameters();
parametersInstance.glob = glob;
parametersInstance.excludeGlob = "**/*.d.ts";
parametersInstance.onlyChangedFiles = true;
return {
name,
pushTest: sdm_1.allSatisfied(pushTest, sdm_1.hasFileContaining(exports.LicenseFilename, /Apache License/)),
// Ignored any parameters passed in, which will be undefined in an autofix, and provide predefined parameters
transform: addHeader_1.addHeaderTransform,
parametersInstance,
};
}
exports.addAtomistHeader = addAtomistHeader;
//# sourceMappingURL=addAtomistHeader.js.map