-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: let the user download the zip file when it does not exist in the…
… folder
- Loading branch information
Showing
2 changed files
with
22 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* eslint-disable no-console */ | ||
|
||
const chalk = require('chalk'); | ||
const fs = require('fs'); | ||
|
||
module.exports = function checkDotDesignDir() { | ||
// check if DESIGN_FILE exists | ||
try { | ||
const hasDotDesignDir = fs.statSync('.design').isDirectory(); | ||
if (!hasDotDesignDir) { | ||
throw new Error('Can not find design.zip or .design folder'); | ||
} | ||
} catch (e) { | ||
console.log(chalk.red.bold( | ||
'You need to download webflow zip file here and rename it as design.zip.' | ||
)); | ||
throw new Error('need webflow design.zip file.'); | ||
} | ||
}; |
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