Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
check if schnack.json file exists
Browse files Browse the repository at this point in the history
gka committed May 24, 2020
1 parent ed31d01 commit e617545
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions create-schnack/index.js
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ const pkg = {
async function main() {
const configPath = path.join(CWD, 'schnack.json');

if (!configPath) {
if (!fs.existsSync(configPath)) {
console.log(`
❌ No schnack.json found!
@@ -34,7 +34,7 @@ async function main() {

const { plugins } = require(configPath);

const packages = Object.keys(plugins).map(id => `schnack-plugin-${id}`);
const packages = Object.keys(plugins || {}).map(id => `schnack-plugin-${id}`);

fs.writeFileSync(path.join(CWD, 'package.json'), JSON.stringify(pkg, null, 4), {
encoding: 'utf-8'

0 comments on commit e617545

Please sign in to comment.