kibana/tasks/build/shasums.js
Spencer d8d65526c6 [eslint] enable no undef (#10825)
* [codeshift] add proper ignore comments

* [codeshift] apply require-to-import transform

* [codeshift/fixup] remove duplicate imports

* [eslint] upgrade config for react "unused" support

* [codeshift] apply remove-unused-imports transform

* [codeshift] apply remove-unused-basic-requires transform

* [codeshift] apply remove-unused-function-arguments transform

* [lintroller] fix argument list spacing

* [codeshift] apply remove-unused-basic-bars transform

* [codeshift/fixup] fixup unused basic var removals

* manually apply remove-unused-assignments transform

* [codeshift] reapply remove-unused-imports transform

* [codeshift] reapply remove-unused-function-arguments transform

* [eslint] autofix param spacing

* manually fix remaining no-undef errors

* use more descriptive file ignore pattern

* add eslint-plugin-react peerDependency

* replace values that looked unused in tests

* remove // kibana-jscodeshift-no-babel comment

* remove import statements from code required by api tests

* Remove '// kibana-jscodeshift-ignore' comments

* address review feedback

* remove remnant of removed if condition
2017-03-22 07:08:23 -07:00

26 lines
799 B
JavaScript

import { promisify } from 'bluebird';
const readdir = promisify(require('fs').readdir);
const exec = promisify(require('child_process').exec);
const platform = require('os').platform();
const cmd = /^win/.test(platform) ? 'sha1sum ' : 'shasum ';
module.exports = function (grunt) {
grunt.registerTask('_build:shasums', function () {
const targetDir = grunt.config.get('target');
// for when shasums is run but archives and ospackages was not
grunt.file.mkdir(targetDir);
readdir(targetDir)
.map(function (archive) {
// only sha the archives and packages
if (!archive.match(/\.zip$|\.tar.gz$|\.deb$|\.rpm$/)) return;
return exec(cmd + archive + ' > ' + archive + '.sha1.txt', {
cwd: targetDir
});
})
.nodeify(this.async());
});
};