diff --git a/packages/gatsby-dev-cli/bin/gatsby-dev b/packages/gatsby-dev-cli/bin/gatsby-dev index d211cfce55149..bb015dcf77eef 100755 --- a/packages/gatsby-dev-cli/bin/gatsby-dev +++ b/packages/gatsby-dev-cli/bin/gatsby-dev @@ -1,36 +1,42 @@ #!/usr/bin/env node -const Configstore = require('configstore'); -const pkg = require('../package.json'); -var argv = require('yargs').array('packages').argv; +const Configstore = require("configstore"); +const pkg = require("../package.json"); +var argv = require("yargs").array("packages").argv; const conf = new Configstore(pkg.name); -const gatsbyLocation = conf.get('gatsby-location'); +if (argv.setPathToRepo) { + console.log("Saving path to your Gatsby repo"); + conf.set("gatsby-location", argv.setPathToRepo); + process.exit(); +} + +const gatsbyLocation = conf.get("gatsby-location"); if (!gatsbyLocation) { - console.log(` + console.log( + ` You haven't set the path yet to your cloned version of Gatsby. Do so now by running: gatsby-dev --set-path-to-repo /path/to/my/cloned/version/gatsby - `) - process.exit() -} - -if (argv.setPathToRepo) { - console.log('setting path to repo') - conf.set('gatsby-location', argv.setPathToRepo) + ` + ); + process.exit(); } if (!argv.packages) { - console.log(` + console.log( + ` You probably want to pass in a list of packages to start developing on! For example: gatsby-dev --packages gatsby gatsby-typegen-remark -`) +` + ); + process.exit(); } -const watch = require('../') -watch(gatsbyLocation, argv.packages) +const watch = require("../"); +watch(gatsbyLocation, argv.packages);