Skip to content

Commit

Permalink
Update scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
mjackson committed Jan 19, 2017
1 parent 5c4324f commit 395b3df
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions scripts/build.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const resolvePath = require('path').resolve
const readFileSync = require('fs').readFileSync
const fs = require('fs')
const path = require('path')
const execSync = require('child_process').execSync
const inInstall = require('in-publish').inInstall
const prettyBytes = require('pretty-bytes')
Expand All @@ -20,7 +20,7 @@ exec('npm run build-umd', webpackEnv)
exec('npm run build-min', webpackEnv)

const size = gzipSize.sync(
readFileSync(resolvePath(__dirname, '../umd/react-router.min.js'))
fs.readFileSync(path.resolve(__dirname, '../umd/react-router.min.js'))
)

console.log('\ngzipped, the UMD build is %s', prettyBytes(size))
8 changes: 4 additions & 4 deletions scripts/release.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
const resolvePath = require('path').resolve
const readFileSync = require('fs').readFileSync
const fs = require('fs')
const path = require('path')
const execSync = require('child_process').execSync
const prompt = require('readline-sync').question

const exec = (command) =>
execSync(command, { stdio: 'inherit' })

const getPackageVersion = () =>
JSON.parse(readFileSync(resolvePath(__dirname, '../package.json'))).version
JSON.parse(fs.readFileSync(path.resolve(__dirname, '../package.json'))).version

if (process.cwd() !== resolvePath(__dirname, '..')) {
if (process.cwd() !== path.resolve(__dirname, '..')) {
console.error('The release script must be run from the repo root')
process.exit(1)
}
Expand Down

0 comments on commit 395b3df

Please sign in to comment.