[READ-ONLY] Mirror of https://github.com/probablykasper/thumbnail-grabber. Chrome extension for grabbing thumbnails/covers
browser-extension chrome chrome-extension chrome-extention extension
0

Configure Feed

Select the types of activity you want to include in your feed.

Fix build error when `dist` folder does not exist

Kasper (Dec 11, 2020, 10:09 PM +0100) 886c21dc 18a1c6d2

+9 -8
+9 -8
tasks.js
··· 21 21 .addColor('green', { color: '#00FE7C', style: ['bold'] }) 22 22 .addColor('red', { color: '#FF0066' }) 23 23 .addColor('cyan', { color: 'cyan', style: ['bold'] }); 24 - tasks = {}; 24 + const tasks = {}; 25 25 26 - async function bundle (options) { 26 + async function bundle(options) { 27 27 del.sync(options.dest); 28 28 const srcFiles = await new Promise((resolve, reject) => { 29 29 glob(src, { nodir: true, ignore: modules }, (err, files) => { ··· 47 47 return bundler; 48 48 } 49 49 50 - tasks['extension:watch'] = async (done, cancel) => { 50 + tasks['extension:watch'] = async(done, cancel) => { 51 51 return new Promise(() => { 52 52 bundle({ watch: true, dest: buildDest }); 53 53 process.on('SIGINT', () => { ··· 56 56 }); 57 57 } 58 58 59 - tasks['extension:zip'] = async (done, cancel) => { 59 + tasks['extension:zip'] = async(done, cancel) => { 60 60 process.env.NODE_ENV = 'production'; 61 61 const manifest = JSON.parse(fs.readFileSync(extensionManifest)); 62 62 const answers = await inquirer.prompt({ 63 63 type: 'input', 64 64 name: 'version', 65 65 default: manifest.version, 66 - message: 'version:' 66 + message: 'version:', 67 67 }); 68 68 manifest.version = answers.version; 69 69 ··· 74 74 type: 'confirm', 75 75 name: 'replace', 76 76 default: false, 77 - message: 'That version already exists. Replace?' 77 + message: 'That version already exists. Replace?', 78 78 }); 79 79 if (answers.replace == false) { 80 80 del.sync(tempBuildDest); 81 81 cancel(); 82 82 return; 83 - }; 83 + } 84 84 } 85 85 86 86 fs.writeFileSync(extensionManifest, JSON.stringify(manifest, null, 2)+'\n'); ··· 100 100 }); 101 101 102 102 zipfile.end(); 103 - zipPath = path.join(extensionZipDest, zipFilename); 103 + const zipPath = path.join(extensionZipDest, zipFilename); 104 104 await new Promise((resolve, reject) => { 105 + if (!fs.existsSync(extensionZipDest)) fs.mkdirSync(extensionZipDest); 105 106 zipfile.outputStream.pipe(fs.createWriteStream(zipPath)).on('close', () => { 106 107 del.sync(tempBuildDest); 107 108 resolve();