forked from epicweb-dev/advanced-react-patterns
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move everything to a package or gists
- Loading branch information
1 parent
99f2002
commit 2d934ce
Showing
15 changed files
with
60 additions
and
2,718 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
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,19 +1,22 @@ | ||
var path = require('path') | ||
var pkg = require(path.join(process.cwd(), 'package.json')) | ||
var spawnSync = require('child_process').spawnSync | ||
|
||
// if you install it then this should be require('workshop-setup') | ||
// but that... doesn't really make sense. | ||
require('./workshop-setup') | ||
.setup(pkg.engines) | ||
.then( | ||
() => { | ||
console.log(`💯 You're all set up! 👏`) | ||
}, | ||
error => { | ||
console.error(`🚨 There was a problem:`) | ||
console.error(error) | ||
console.error( | ||
`\nIf you would like to just ignore this error, then feel free to do so and install dependencies as you normally would in "${process.cwd()}". Just know that things may not work properly if you do...`, | ||
) | ||
}, | ||
console.log('▶️ Starting workshop setup...') | ||
|
||
var error = spawnSync('npx --version', {shell: true}) | ||
.stderr.toString() | ||
.trim() | ||
if (error) { | ||
console.error( | ||
'🚨 npx is not available on this computer. Please install npm@5.2.0 or greater', | ||
) | ||
throw error | ||
} | ||
|
||
var result = spawnSync( | ||
'npx "https://gist.github.com/kentcdodds/bb452ffe53a5caa3600197e1d8005733" -q', | ||
{stdio: 'inherit', shell: true}, | ||
) | ||
|
||
if (result.status === 0) { | ||
console.log('✅ Workshop setup complete...') | ||
} |
Oops, something went wrong.