WIP convert CJS to ESM using https://github.com/homer0/cjs2esm
This commit is contained in:
+7
-12
@@ -1,16 +1,11 @@
|
||||
#!/usr/bin/env node
|
||||
#!/usr/bin/env node// Bad news: We have to write plain ES5 in this file
|
||||
import semver from 'semver';
|
||||
|
||||
// Bad news: We have to write plain ES5 in this file
|
||||
// Good news: It's the only file of the entire project
|
||||
import execa from 'execa';
|
||||
import findVersions from 'find-versions';
|
||||
import pkg from '../package.json';
|
||||
|
||||
/* eslint-disable no-var */
|
||||
|
||||
var semver = require('semver');
|
||||
var execa = require('execa');
|
||||
var findVersions = require('find-versions');
|
||||
var pkg = require('../package.json');
|
||||
|
||||
var MIN_GIT_VERSION = '2.7.1';
|
||||
const MIN_GIT_VERSION = '2.7.1';
|
||||
|
||||
if (!semver.satisfies(process.version, pkg.engines.node)) {
|
||||
console.error(
|
||||
@@ -23,7 +18,7 @@ See https://github.com/semantic-release/semantic-release/blob/master/docs/suppor
|
||||
|
||||
execa('git', ['--version'])
|
||||
.then(({stdout}) => {
|
||||
var gitVersion = findVersions(stdout)[0];
|
||||
const gitVersion = findVersions(stdout)[0];
|
||||
if (semver.lt(gitVersion, MIN_GIT_VERSION)) {
|
||||
console.error(`[semantic-release]: Git version ${MIN_GIT_VERSION} is required. Found ${gitVersion}.`);
|
||||
process.exit(1);
|
||||
|
||||
Reference in New Issue
Block a user