UNPKG

1.65 kBJavaScriptView Raw
1#!/usr/bin/env node
2
3// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4// /!\ DO NOT MODIFY THIS FILE /!\
5// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6//
7// create-react-wptheme is installed globally on people's computers. This means
8// that it is extremely difficult to have them upgrade the version and
9// because there's only one global version installed, it is very prone to
10// breaking changes.
11//
12// The only job of create-react-wptheme is to init the repository and then
13// forward all the commands to the local version of create-react-wptheme.
14//
15// If you need to add a new command, please add it to the scripts/ folder.
16//
17// The only reason to modify this file is to add more warnings and
18// troubleshooting information for the `create-react-wptheme` command.
19//
20// Do not make breaking changes! We absolutely don't want to have to
21// tell people to update their global version of create-react-wptheme.
22//
23// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
24// /!\ DO NOT MODIFY THIS FILE /!\
25// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
26
27"use strict";
28
29var chalk = require("chalk");
30
31var currentNodeVersion = process.versions.node;
32var semver = currentNodeVersion.split(".");
33var major = semver[0];
34
35if (major < 8) {
36 console.error(chalk.red(`You are running Node ${currentNodeVersion}.`));
37 console.error(chalk.red("Create React WP Theme requires Node 8 or higher."));
38 console.error(chalk.red("Please update your version of Node."));
39 process.exit(1);
40}
41
42require("./createReactWpTheme");