Skip to content

Commit

Permalink
👟 remove versionTick make task
Browse files Browse the repository at this point in the history
  • Loading branch information
desandro committed Jun 2, 2019
1 parent f7b8761 commit 5ad172b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ lint:

dist: bundle uglify

versionTick:
version:
node ./tasks/version

version: versionTick dist
make dist
git add -A dist js
5 changes: 3 additions & 2 deletions tasks/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@ const fs = require('fs');
const execSync = require('child_process').execSync;

// get file paths from index.js
let indexSrc = fs.readFileSync( './js/index.js', 'utf8' );
const indexPath = 'js/index.js';
let indexSrc = fs.readFileSync( `./${indexPath}`, 'utf8' );
let cjsBlockRegex = /module\.exports = factory\([\w ,'\.\-\(\)\/\n]+;/i;
let cjsBlockMatch = indexSrc.match( cjsBlockRegex );
let paths = cjsBlockMatch[0].match( /require\('([\.\-\/\w]+)'\)/gi );

paths = paths.map( function( path ) {
return path.replace( `require('.`, 'js' ).replace( `')`, '.js' );
});
paths.push('js/index.js');
paths.push( indexPath );

execSync( `cat ${paths.join(' ')} > dist/zdog.dist.js`);

Expand Down

0 comments on commit 5ad172b

Please sign in to comment.