-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add missing dependency configstore * Add note about needing to set path to cloned repo * Fix gatsby-dev logic
- Loading branch information
1 parent
82ff66a
commit 80e93d6
Showing
1 changed file
with
22 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); |