Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
Add semver check to truffle preserve
Browse files Browse the repository at this point in the history
  • Loading branch information
rkalis committed Mar 10, 2021
1 parent f926e70 commit fce8206
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/core/lib/commands/preserve/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,14 @@ module.exports = {
description:
"Save data to decentralized storage platforms like IPFS and Filecoin",
help: async options => {
const TruffleError = require("@truffle/error");
const { Plugins } = require("@truffle/plugins");
const { getConfig } = require("./plugins");
const semver = require("semver");

if (!semver.satisfies(process.version, ">=12")) {
throw new TruffleError(`The current version of Node (${process.version}) does not support \`truffle preserve\`, please update to Node >=12`);
}

const config = getConfig(options);

Expand Down Expand Up @@ -35,6 +41,11 @@ module.exports = {
const { Plugins } = require("@truffle/plugins");
const { getConfig, constructPlugins } = require("./plugins");
const { preserve, ConsoleReporter } = require("@truffle/preserve");
const semver = require("semver");

if (!semver.satisfies(process.version, ">=12")) {
throw new TruffleError(`The current version of Node (${process.version}) does not support \`truffle preserve\`, please update to Node >=12`);
}

const config = getConfig(options);

Expand Down

0 comments on commit fce8206

Please sign in to comment.